I have datable code to create a string that is sb.ToString ().
DataTable dt = dbaccess.GetDataTable("TEST");
List<DataRow> drlist = dt.AsEnumerable().ToList();
StringBuilder sb = new StringBuilder();
foreach (DataRow row in drlist)
{
foreach (string str in row.ItemArray)
{
sb.Append(str);
}
}
The data is
NULL
0
138
337
1666
1680
2511
8113
You see that there is "NULL" to cause the error "Unable to pass an object of type" System.DBNull "to enter" System.String ". How to fix this?
user1108948
source
share