Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding Checkbox to nchar column
Message
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01445996
Message ID:
01446003
Views:
38
>>Hi,
>>
>>I have a column in a table of type nchar(1). The value in this column is "A" or "I". I want to bind this column to a check box and show in the caption of the check box "Active" (for 'A') and "Inactive" for 'I'
>>
>>I tried the following binding code but get error:
>>
>>
>>this.chkStatus.DataBindings.Add("Checked", bindingSource1, "Status=='A'");
>>
>>
>>What am I doing wrong? TIA.
>
>Why not make your life easier and just change the type of the column to bit 1=Active 0=Inactive?
>True and False.

Good point, Borislav. When I was writing the question I thought about the same. But I am sure, even if I change this column to a bit type there will be future cases where I may need to bind a check box to a string column.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform