Hello,
I am not an experienced programmer so I might have missed something easy here but I'm having trouble here:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
using (SqlConnection connection = new SqlConnection(blablabla))
{
connection.Open();
SqlCommand command = new SqlCommand(blabla)
SqlDataReader reader1 = command.ExecuteReader();
.....
while (reader1.Read())
{
CheckBoxFactor.Checked = reader1[8].ToString();
.....
In this interface once you click on this button in the gridview you can edit that field, which consists of numerous textboxes (all of which are saved into a database). I only have one checkbox which I recently added (I've hidden the textboxes in the above code) which also saves to a column in the database. I'm getting the following error:
Cannot implicitly convert type 'string' to 'bool
The column in the database saves to either true or false depending on wether the checkbox is checked. The column in the database for the checkbox is of the "bit" datatype.
I can't figure out a way to convert it into string, ive tried parsing but it's not working. Or am i supposed to use something different than ExecuteReader() for checkboxes? Thanks in advance.