vb.net - Error handling with data tables -


i have loop data table , i'm trying figure out if data table has no rows in it. ignore fact there no rows in , move on or fail , give , exception? here's code loop, question should same in cases.

  each dr datarow in dt.rows       if not isdbnull(dr.item("materialid")) , dr.item("materialid") isnot nothing           listofresults.add(cuint(dr.item("materialid")))       else           trace.traceerror("error details: {0} stack: {1}", "the materialid nothing/null", system.reflection.methodinfo.getcurrentmethod.tostring)       end if  next 

if datatable has no rows hit loop , exit , execute next statement after loop. note : if datatable dt nothing throw exception.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -