Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding Checkbox to nchar column
Message
From
26/01/2010 13:16:42
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01445996
Message ID:
01446013
Views:
33
Dmitry,

>>>1. I have noticed that both of your checkbox classes (BBCheckBoxString and BBCheckBox) are designed to be bound to a string column. Do I understand that I would need to create another class - e.g. XXCheckBoxBit - to bind a checkbox to a bit type column?
>>
>>No, the second one (BBCheckBox) is your typical CheckBox, designed to be bound to a boolean value (bit in the database), which most of the time you want to do. I'm not sure what gave you the impression it was for a string datatype.
>>
>
>Why then the code in the DataBind of the second class has "string column"?

That's the column name in the DataTable that you're binding to! You'd use the DataBind method like this:
this.MyCheckBox.DataBind(MyTable, "MyBoolColumn");
~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform