I have an SQL database table with an datatype bit for the Active field. I populate a gridview with the results of a stored procedure and am trying to hide the row where the Active (data type bit) = 0, the field name is Active. Anyhow I have the following.
Foreach (gridViewRow gvr in gvw.Rows) //gvw is the gridview control
{
Boolean btemp = Convert.ToBoolean(gvr.Cells[11].Text);//11 is the column that contains the Active data (bit data type).
//code here to hide row if btemp = 0//
}
this creates a runtime conversion error, string not recognized as a valid boolean.
any ideas?