Ok, I'm writing a program that's meant to interact with an access database containing student information. I have a form that retrieves and displays the information using the following code:
Unfortunately, my professor neglected to tell me how exactly to UPDATE the information back into the database once it's been edited.
I also have a second form that has the same text boxes and a button called btnAdd that's meant to add a record to the database. I assume this is done with the same method used to update a record. If anyone can explain the process to me briefly I would be much obliged.
VB.NET:
OleDbDataAdapter1.SelectCommand.CommandText = "select * from StudentTable where StudentNumber = '" & txtFind.Text & "'"
OleDbDataAdapter1.Fill(DsStudent1)
txtNumber.Text = Convert.ToString(DsStudent1.Tables(0).Rows(0)("StudentNumber"))
txtName.Text = Convert.ToString(DsStudent1.Tables(0).Rows(0)("StudentName"))
txtPhone.Text = Convert.ToString(DsStudent1.Tables(0).Rows(0)("PhoneNumber"))
txtEnrollDate.Text = Convert.ToString(DsStudent1.Tables(0).Rows(0)("EnrollDate"))
txtLoanAmount.Text = Convert.ToString(DsStudent1.Tables(0).Rows(0)("StudentLoan")
I also have a second form that has the same text boxes and a button called btnAdd that's meant to add a record to the database. I assume this is done with the same method used to update a record. If anyone can explain the process to me briefly I would be much obliged.