Sunday, November 21, 2010

How do I update MySQL database using VB 2005?

The database works as to connection and navigation. I used DataSet, DataTable, DataAdapter, and CurrencyManager. I display data using textboxes which are NOT binded by:



TextBox.Text = DataTable.DefaultView(Cur

rencyManager.Position).It

em(';Column1';).ToString



To add record, I clear the textboxes, put data into them and click a save button which does:



CurrencyManager.AddNew()

DataTable.DefaultView(Cur

rencyManager.Position).It

em(';Column1';) = TextBox.Text

CurrencyManager.EndCurren

tEdit()



Everything works fine and I can navigate through each record plus the new record in the program. The problem is when I close the program and open it again, the changes were not saved to the MySQL database.



Does anyone know why? And how will I go about updating MySQL database?How do I update MySQL database using VB 2005?
Try

DataAdapter.Update(DataTable)

No comments:

Post a Comment