|
-
March 29th, 2009, 02:14 AM
#1
Binding in 1 direction only (control to dataset)
Hi,
I am using form 2.0 to create a form in visual studio 2008. In this form, there is a textbox. I bind this textbox to a datatable , which will be populated by the data in the sql server database, when the form is launched.
Now here is the problem. I want my textbox to be empty initially, so that when user enter a value and press the save button, the value in the textbox will goes into the datatable.
But whenever I launch my form, my textbox always get populated by some value (I am not suprise since my textbox is binded to a datatable's column).
So question is how to I make my textbox empty initially while it is still bind to the datatable?
Last edited by hanct; March 29th, 2009 at 06:07 AM.
-
March 29th, 2009, 06:48 AM
#2
Re: Binding in 1 direction only (control to dataset)
The solution is pretty simple. Don't bind the datatable. The better way would be to add the record to the datatable manually once the user presses save button. Another option is to write the insert query for inserting data into database directly.
-
March 29th, 2009, 09:48 AM
#3
Re: Binding in 1 direction only (control to dataset)
Thanks! Adding record to the datatable manually is ok if there is only a few control. if I have 100s of controls , I have to add them manually....quite tedious. If only visual studio have a way to bind these controls to the dataset in 1 direction (from control to dataset) with a few click of mouse, how good would that be...
-
March 29th, 2009, 10:08 AM
#4
Re: Binding in 1 direction only (control to dataset)
 Originally Posted by hanct
Thanks! Adding record to the datatable manually is ok if there is only a few control. if I have 100s of controls , I have to add them manually....quite tedious. If only visual studio have a way to bind these controls to the dataset in 1 direction (from control to dataset) with a few click of mouse, how good would that be...
I am not aware of any way of binding the controls to a dataset/datatable in just one way.
-
March 30th, 2009, 06:54 AM
#5
Re: Binding in 1 direction only (control to dataset)
ok. Thanks. Hope someone is aware of such method..if it ever exists.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|