Hi Jerry_lth,
I believe that there is one or more column that does not allow null value. You can check it out by loop through all columns and check the AllowDBNull property. Try the following code:
Code Block
foreach (DataColumn col in dataset.Tables[0].Columns)
{
if (!col.AllowDBNull)
System.Console.WriteLine(col.ColumnName + " does not allow null value!");
}
Hope this helps.
Best regards.
Rong-Chun Zhang