Simple Binding with Textbox Control

S

Sam

Hi guys,

I'm learning ADO.Net and I'm having trouble with binding a simple control,
the textbox. The problem that I'm having is updating the Northwind database
data through textbox controls. I can display, and update my data through my
datagridview control but I cannot update the data if I bind my DataSet
object through textbox controls(I can display them) .

When I run an update command( DACustomers.Update(DSCustomers1)), there is no
strange.

Does anyone have any idea what could cause this problem? Any help is greatly
appreciated.

Regards,

Sam
 
C

Cor Ligthert [MVP]

Sam,

That is forever the same, if you have clicked the update button than the
data is not yet pushed into the datasource that you use.

You can do that with EndCurrentEdit.

By the way have a look at this sample.

http://www.vb-tips.com/default.aspx?ID=c6c7d9a8-7511-41a1-a488-2e91e5295e7c

If it would be to a real database than before the update you would have to
do.
cma.endcurrentedit
Or if you have not created a currencymanager
bindingcontext(dt).endcurrentedit

(dt is exact the name for the datasource that you use in your second
paramater description of the binding ).

I hope this helps,

Cor
 
S

Sam

Hi Cor,

Thanks for the help. I'm looking at the example on the link. I have not
created the currencymanager because I thought the DataAdapter can do the
update just as it does with data on the datagrid control. And this is the
point that I don't quite understand why it does not work with the textbox

Regards,

Sam
 
C

Cor Ligthert [MVP]

Sam,

I gave the sample because I wanted to show you this easy way with the
currencymanager.

The update is probably not done because the lack of that "endcurrentedit".

(That is it at least in 80% of this questions)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top