Moti Mashiah
asked on
C# checkbox code
Hi Carl ,
I hope you still here :)....after the db guy created the new database and tables he added more columns and requested to add them to the app soo i did add these columns to the app and now it look like this see screenshot...
my missed understanding for now is how to add the checkbox to the column closed which provide database as "false or true" I want the checkbox to show me "v" inside the box and instead it shows me the word true or fales.
I have written the code for this checkbox this way:
I hope you still here :)....after the db guy created the new database and tables he added more columns and requested to add them to the app soo i did add these columns to the app and now it look like this see screenshot...
my missed understanding for now is how to add the checkbox to the column closed which provide database as "false or true" I want the checkbox to show me "v" inside the box and instead it shows me the word true or fales.
I have written the code for this checkbox this way:
string scheck = Reader.GetBoolean(Reader.GetOrdinal("closed")).ToString();
checkbox1.Text = scheck;
Capture.JPG
Instead of setting the text property, set the checked property.
ASKER
that way I will see the "V" always in to the box.
My intention is to see the "V" in the checkbox when the database say true.
My intention is to see the "V" in the checkbox when the database say true.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks ,
After I changed I got this issue "cannot implicitly convert type string to bool
After I changed I got this issue "cannot implicitly convert type string to bool
Declare scheck as a Boolean instead of a string.
bool scheck = Reader.GetBoolean(Reader.G etOrdinal( "closed"))
bool scheck = Reader.GetBoolean(Reader.G
ASKER
Thank you very much now it works fine..
I have one more question:
I would like to query just the false from the "Close" Column. I assume I need some if statement for this.
can you help with the code.
I have one more question:
I would like to query just the false from the "Close" Column. I assume I need some if statement for this.
can you help with the code.
ASKER
solved my problem
If NOT checkbox1.Checked then
'do your processing
End if
'do your processing
End if