For Each Row: Object reference not set to an instance of an object Uipath Im Getting This Error

For Each Row: Object reference not set to an instance of an object

Hi @Ajit_Chowdary

Could you check whether the DataTable has values or not?

IsNothing(dt)

You could check in the Immediate as well, if it returns null, that means there DataTable has not been initialized.

Kind Regards
Ashwin A.K

hai Ashwin can you plz help me where i have to check and what i have to do

@Ajit_Chowdary

Check DataTable row count using Message Box activity.

           dt.Rows.Count

do a quick assign above your for each loop with variable Integer and replace after the = with your dt name then do a write line dtRowCount.toString. If there are no rows you will get 0

dtRowCount = dt.rows.count

To intialize your datatable go to the variable panel and in default type New System.Data.DataTable

@Ajit_Chowdary

Remove double quotes from row(0).ToString and then check it once.

Thank You @lakshman I am one more doubt can u plz help me

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.