DatagridView boolean values update to database
<p>I'm having an issue when I update values from a datagridview row to the database. The issue is that I have designed the table in the DB with certain fields as "bit" data type to store boolean value flags.</p>

<p>When i assign the datatable to the datagridview the system aytomatically displays these certain fields as checkboxes, which suits me just fine.</p>

<p>But when I try to update these values back to the database the boolean values go bananas.....Here is my code...</p>

<pre><code>int fragileChk = (Convert.ToBoolean(aRow.Cells[12].Value) ? 1 : 0);
int inflamChk = (Convert.ToBoolean(aRow.Cells[13].Value) ? 1 : 0);
int biologicalChk = (Convert.ToBoolean(aRow.Cells[15].Value) ? 1 : 0);
int emergencyChk = (Convert.ToBoolean(aRow.Cells[16].Value) ? 1 : 0);
int usedChk = (Convert.ToBoolean(aRow.Cells[25].Value) ? 1 : 0);
int offerChk = (Convert.ToBoolean(aRow.Cells[27].Value) ? 1 : 0);

string err;
string sqlComm = "UPDATE [70_warehouse_lines] SET " +
                 "ProductDescr = '" + aRow.Cells[5].Value.ToString() + "', " +
                 "PartNumber = '" + aRow.Cells[6].Value.ToString() + "', " +
                 "SerialNumber = '" + aRow.Cells[7].Value.ToString() + "', " +
                 "Quanitity = " + aRow.Cells[8].Value + ", " +
                 "Weight = " + aRow.Cells[10].Value + ", " +
                 "FragileFlag = " + fragileChk + ", " +
                 "InflammableFlag =" + inflamChk + ", " +
                 "BiologicalFlag = " + biologicalChk + ", " +
                 "EmergencyFlag = " + emergencyChk + ", " +
                 "SpecialInstructions = '" + aRow.Cells[17].Value.ToString() + "', " +
                 "ShopCostPrice = " + aRow.Cells[19].Value + ", " +
                 "RetailPrice1  = " + aRow.Cells[20].Value + ", " +
                 "RetailPrice2 = " + aRow.Cells[21].Value + ", " +
                 "WholePrice1 = " + aRow.Cells[22].Value + ", " +
                 "WholePrice2 = " + aRow.Cells[23].Value + ", " +
                 "CalculatedPrice = " + aRow.Cells[24].Value + ", " +
                 "UsedParts = " + usedChk + ", " +
                 "TimesProcessed = " + aRow.Cells[26].Value + ", " +
                 "OnOffer = " + offerChk + ", " +
                 "NotesPerPart = '" + aRow.Cells[28].Value.ToString() + "' " +
                 "WHERE WarehouseLineID = '" + aRow.Cells[0].Value.ToString() + "'";

myConn.ExecSqlCmd(sqlComm, out err);                                  
</code></pre>

<p>any ideas ? (I have declared int values just for diagnostic purposes. Thank you in advance for your help.</p>