How do VB.NET use TextBox to modify data in a database? ? ?

xiaoxiao2021-03-06  104

1 I am connected to the Access database (OLEDBCONNECTION1) 2 is centered by the wizard (Dataset: DataSet11 ;; Adapter: OLEDBDataAdapter1 ;; Database: BOOK.MDB ;; Data table has one: bookinfo; 1: How to implement it "Button "You can save us in the textBox1 and TextBox2 to save to the database?"

2: Query: I use a ComboBox (to select the query type: I can check with a teacher / name); use a TextBoo3 (to enter query conditions), press "Button2" to find what we think.

Here is my part of my code (implementing the modification function, where bookinfo is a table, and the book number is the field in the table): Private Sub Button2_Click (Byval E AS System.EventArgs) Handles Button2 .Click DataSet11.Tables ( "bookinfo"). Rows (DataGrid1.CurrentRowIndex) ( "ISBN") = TextBox1.Text DataSet11.Tables ( "bookinfo"). Rows (DataGrid1.CurrentRowIndex) ( "book name") = TextBox2 .Text dataset11.tables ("bookinfo"). Rows (DataGrid1.currentrowindex) ("Book author") = TextBox3.Text DataSet11.Tables ("bookinfo"). Rows (DataGrid1.currenTrowIndex) ("Book Category" = TextBox4 .Text dataset11.tables ("bookinfo"). Rows (DataGrid1.currentrowindex) ("Published Time") = TextBox5.Text OledbdataAdapter1.Update (Dataset11, "BookInfo") End Sub, please grate!

转载请注明原文地址:https://www.9cbs.com/read-97698.html

New Post(0)