Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding Checkbox to nchar column
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01445996
Message ID:
01446009
Vues:
33
>>>>>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.
>>
>>But how complex that could be?
>>CheckBox has 3 values:
>>True
>>False
>>NULL
>>
>>So you could handle it with a simple bit field that allow NULL :-)
>
>Excellent point, again. Thank you. (So, I see you moved to .NET world too. I am glad I am in a good company :)).

No,
I just know SQL Server :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform