For example i have the following fields in the database
name, student number, course
then i have multiple data in the database e.g. 25rows = 25 students
when i try to edit them, you need to first click the row in the datagrid that you want to edit
then ive used this code to send the information of the student from the datagrid into multiple textbox
txtname.Text = Adodc1.Recordset.Fields.Item("dbname").Value
txtstudentnumber.Text = Adodc1.Recordset.Fields.Item("dbstudentnumber").Value
txtcourse.Text = Adodc1.Recordset.Fields.Item("dbcourse").Value
THIS IS THE CODE IVE USED TO PASS THE DATA IN THE TEXTBOX IF YOU CLICK A SPECIFIC ROW IN THE DATAGRID
adodc1.recordset!dbname = txtname.text
adodc1.recordset!studentnumber = txtstudentnumber.text
adodc1.recordset!dbcourse = txtcourse.text
Adodc1.Recordset.Update
THIS IS MY CODE IN UPDATING THE SPECIFIC ROW IN DATABASE BUT IT ONLY REPLACES THE FIRST ROW OF INFORMATION IN MY DATABASE, EVEN IVE CLICKED DIFFERENT ROW e.g. 12TH ROW IN THE DATABASE IT REPLACES THE FIRST ROW IN THE DATABASE
but after ive click the save button it replaces/ edit the first row in the database and not the specific row that has been clicked in the datagrid...
i dont have idea what is the exact code for updating the specific row, because i used the code above to insert a new information in the database using adodc1.recordset.addnew
I need help in creating/ having a code that if you clicked a specific row in the datagrid it will pass the information in the textbox, then after you clicked a button to update it it will edit the clicked row in the datagrid/ database...
Also I need help in deleting specific row in the datagrid. database
thanks in advance :)