I have a check box in my c# winform app. When I checked and save, it goes to MySQL table as a tinyint value (1). But When I try to retrieve that record, I was in a trouble.
sql = "SELECT replacserial,recieveddate,replacedate,senttosupdate,sentcourier,tracknum, " +
"suppjobno,sentcomments,isrecievfromsupp,recievfromsuppdate,isreplaced,iscreditnote, " +
"replacedby,replacedcomment,issenttosup FROM warrantymanage WHERE id='" + strId +"' AND lcode='"+ Globe.locaCode +"'";
config.singleResult(sql);
if (config.dt.Rows.Count > 0)
{
bool isRecievedfromSup = false;
// isRecievedfromSup = Boolean.TryParse(config.dt.Rows[0].Field<int>("isrecievfromsupp").ToString());
//isRecievedfromSup = config.dt.Rows[0].Field<bool>("isrecievfromsupp") as bool? ?? false;
isRecievedfromSup = config.dt.Rows[0][8] as bool? ?? false;
It doesn't get the database value to the variable. Can anyone help me?