Databindings and Textboxes

Xero

Newcomer
Joined
Dec 14, 2004
Messages
2
The problem i am having is understand Databindings fully...

What i think databindings does it binds the data to a textbox lets say and if you change the textbox shouldn't that in theory change the data set that its bound to???

If not how can i go about doing this. I have a bunch of textboxes with Databindings to a Dataset thats being read in from a table. What I would like to do is be able to change the textbox and then update the table from there. How is this possible?
 
Actually what you wrote is exactly what data binding is. Data binding binds information from a datatable (or the 0th datatable of a dataset) to a control.

I believe what you're missing is the understanding that what you are binding to the text box is not the database table, but to disconnected copy of information in that table.

Any changes you make to the data table aren't applied to your database table until you execute a command to perform those changes.

There are a variety of ways to do this. Using the least amount of thought,
Microsoft developed an SQLCommandBuilder, I believe oledb has a counter part as well. It writes the sql command for updating your table with the changes that were made to the data table.

Check out Microsoft's own explaination:
http://support.microsoft.com/kb/308055/EN-US/


Xero said:
The problem i am having is understand Databindings fully...

What i think databindings does it binds the data to a textbox lets say and if you change the textbox shouldn't that in theory change the data set that its bound to???

If not how can i go about doing this. I have a bunch of textboxes with Databindings to a Dataset thats being read in from a table. What I would like to do is be able to change the textbox and then update the table from there. How is this possible?
 
Back
Top