Hi I would appreciate any help possible to this problem. I am new to .NET and ADO.NET so this might be a very simple problem.
I have a datagrid which displays Student records from a dataset 'DsStudents'21 The Datagrid is filtered however by each class group. I use a combo box for this. I need to edit/update these records in another form ("Update") using textboxes bound to the relivent columns in the dataset.
I want the user to select a row and click an "Edit" button to show the "Update" form with the textboxes populated with the current record.
So, How do I open the "Update" form with the textboxes filled with the currently selected row of the datagrid. Remembering that the datagrid does not show all the records in the table.
Here is the code I use to load the datagrid (except the call to LoadTable() )
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
'Loads a list of unique ClassNames
DsCombo1.Clear()
OleDbDataAdapter2.Fill(DsCombo1)
EndSub
Sub LoadTable()
OleDbDataAdapter3.SelectCommand.Parameters("ClassName").Value = cmboClass.Text
'placing a value into the SQL parameter corresponding to the ClassName field
DsStudents21.Clear()
OleDbDataAdapter3.Fill(DsStudents21)
EndSub
-Thank You!-
I have a datagrid which displays Student records from a dataset 'DsStudents'21 The Datagrid is filtered however by each class group. I use a combo box for this. I need to edit/update these records in another form ("Update") using textboxes bound to the relivent columns in the dataset.
I want the user to select a row and click an "Edit" button to show the "Update" form with the textboxes populated with the current record.
So, How do I open the "Update" form with the textboxes filled with the currently selected row of the datagrid. Remembering that the datagrid does not show all the records in the table.
Here is the code I use to load the datagrid (except the call to LoadTable() )
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
'Loads a list of unique ClassNames
DsCombo1.Clear()
OleDbDataAdapter2.Fill(DsCombo1)
EndSub
Sub LoadTable()
OleDbDataAdapter3.SelectCommand.Parameters("ClassName").Value = cmboClass.Text
'placing a value into the SQL parameter corresponding to the ClassName field
DsStudents21.Clear()
OleDbDataAdapter3.Fill(DsStudents21)
EndSub
-Thank You!-