ADO.Net and Saving a record

B

Bruce A. Julseth

I have a form with several simple bound controls(txtBoxes). I am using
VB.NET built DataAdaptor, DataSet, Delete, Insert, Select and Add commands.

I have a Save button for Inserting records that contains one line of code,
"Adaptor.Update(DataSet)" This doesn't seem to work.

How ever I also have a MoveNext button, with

Me.BindingContext(DataSet, "Database").Position += 1
Adaptor.Update(DataSet)

This leads me to believe that the only way I can save a record is to "Move
off the record."

Is this true, or is there someway, using "bound controls", that I can Insert
a record.

Thank you

Bruce
 
C

Cor Ligthert

Bruce,

That is true, the data will be pushed into a datatable after a row change.

Luckily you can force that however as well.

When you set.
\\\
BindingContext(ds.Tables("DataTable")).EndCurrentEdit()
///
Before the update is enough for that.

I hope this helps,

Cor
 
B

Bruce A. Julseth

Bruce A. Julseth said:
Cor:'

Thank you.. I'll give that a try..

Bruce

Cor:

THANK YOU. Your suggestion does EXACTLY what I was looking for.

Appreciate you taking the time to respond..

Bruce
 

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