Databinding: AddNew on Dataform with checkbox

  • Thread starter Thread starter garak
  • Start date Start date
G

garak

Hi,

I have a problem with a dataform Application using c# and MS SQL
Server 2000.
If I only have Textboxes on my form everything works fine (Navigation,
Update, Add, Delete).
When I also have a checkbox on my form which refers to a TINYINT field
in my DB I cant add a new row. Updating and Navigation works fine.
When I hit the ADD button on my form the fields does not clean up the
fields – even the textfield have their old values.

Code for binding the checkbox:
chkFieldValue[curCol].DataBindings.Add("Checked", DS_SelTable,
"SelTable." + ColName);

Code for the add-button:
BindingContext[DS_SelTable,"SelTable"].AddNew();

Can anyone help ?

Thanks
Frank
 
you cannot add row. but, it gives you an error? or just without adding any
row it continue to work.

If possible, try to use BIT datatype instead of TINYINT in sqlserver column.
where you would like to apply checkbox.

Rajesh Patel

garak said:
Hi,

I have a problem with a dataform Application using c# and MS SQL
Server 2000.
If I only have Textboxes on my form everything works fine (Navigation,
Update, Add, Delete).
When I also have a checkbox on my form which refers to a TINYINT field
in my DB I cant add a new row. Updating and Navigation works fine.
When I hit the ADD button on my form the fields does not clean up the
fields – even the textfield have their old values.

Code for binding the checkbox:
chkFieldValue[curCol].DataBindings.Add("Checked", DS_SelTable,
"SelTable." + ColName);

Code for the add-button:
BindingContext[DS_SelTable,"SelTable"].AddNew();

Can anyone help ?

Thanks
Frank
 
I gave the BIT field a try, but ADD NEW still does not work.
There ist no Error Message comming up...
 
Back
Top