Hi all,
I wonder how to add a bool value (true/false) to a datarow, I tried the following two ways, both don't work:
1.
bool selected = false;
DataRow dr = ds.Tables[0].NewRow();
dr[0] = selected;
ds.Tables[0].Rows.Add(dr);
2.
item = false;
ds.Tables[0].Rows.Add(Item);
What's the problem?
Thanks.
Loading
tolikrPosted Oct 22, 2005, 12:10 AM
Hi,
You didn't specify the error message but it seems like the error caused by either ds or table.
Try to debug the application and see whether this line "dr[0] = selected;" has an error before you
add it to the Rows collection.