databinding textboxes

G

Guest

ive bound textboxes in design and in code.

changes to the textboxes are reflected in the dataset, however, such changes do not get updated in the database. i have no problem with updating datagrids etc..

please advise...
thanks
 
C

Cor Ligthert

Hi Subt,

In 80% it helps when you set this before the update with the right table.

BindingContext(ds.Tables(0)).EndCurrentEdit()

I hope this helps?

Cor
changes to the textboxes are reflected in the dataset, however, such
changes do not get updated in the database. i have no problem with updating
datagrids etc..
 
W

William Ryan eMVP

Hi SubT:

in message news:[email protected]...
ive bound textboxes in design and in code.

Probably not necessary to do both.
changes to the textboxes are reflected in the dataset, however, such
changes do not get updated in the database. i have no problem with updating
datagrids etc..

Cor already pointed you to the most likely culprit but I'd recommend taking
a look at something http://www.knowdotnet.com/articles/efficient_pt4.html.
If you didn't call endcurrentedit, then the dataset will look changed but
not be changed. As such, calling update all year won't do anything. Before
you call update, I'd throw in a Debug.Assert(dataSetName.HasChanges, "No
Changes Seen in DataSEt");

This isn't necessary in production code or when it's doing what you want,
but if you aren't sure why th eupdate is failing, this is the most logical
place to start, putting it right before the call to update. I'd also verify
that I don't have any try catch blocks that just eat the exception and don't
respond (this is never a good practice).
please advise...
thanks



--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
"subT" <[email protected]> wrote
 

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