Bound Text boxes not updating table

  • Thread starter Thread starter Mr B
  • Start date Start date
M

Mr B

I had originally posted this in another thread, but did not get and results.
I appologize for cross posting but I really would like to get some assistance
with this.

I am new to developing in VB.net so my question may be very elementary with I
need some assistance, so here goes:

I am using vb.net 2003.

I have a form with four bound text boxes. I am using an ODBC data adapter
connecting to an Access database file. I am using the following line of code
in the on Load event of the form to populate the text boxes:

Me.OdbcDataAdapter1.Fill(Me.DsSomeInfo1, "tblSomeInfo")

There is only one record in the table and that record is displayed when i
run the project.

However, when I make any change to any of the four fields, the changes are
not being updated in the "tblSomeInfo" table.

Here is the code that I am using in the click event of a Save Button:

Me.OdbcDataAdapter1.Update(Me.DsTeamsInfo1, "tblTeamsInfo")
Me.Close()


After this code runs (and I have validated that is is running) the changes
to the data in the table has not changed.
 
Mr. B.

You tell that you are crossposting, crossposting is sending one message to
more newsgroup in one time. Probably you are multiposting this, at
crossposting everybody can see if there are given answers. Do you have
already answers. Because I don't know what the other answers are, would I in
your case first change the ODBC to OleDB. ODBC is not the nicest to use in
..Net.

And then somewere (by instance before the update.

dim cmb as New OleDBCommandbuilder(OleDBDataAdapter1)

(It is not impossible this works with ODBC as well, however that is so
seldom used in Net that I have no idea if that works).

Cor
 
Cor,

Thanks for the reply. I had been researching this and had found a thread
somewhere that indicated that the OleDBDataAdapter was a much better choice.

I have been able to make things work as I was expecting by making the change.

Thanks again.

Mr B
 
Back
Top