I am new to vb.net please be gentle..
I have a datagrid i use for searching. When the user clicks the record they want I want the textbox to reflect the record selected. I want them to be bound so that I can call the adapters update method for minimal coding. I am sure I can code this the long way
I have bound the text box to the dataset but it only shows the first record I would have thought that it would disply they same data when changed as they are both bound to the same data set any way here is the code..also my row count doesn't work
dapStaff = New SqlDataAdapter(sQuery, cnn)
dapStaff.Fill(ds, "tblStaff")
bld1 = New SqlCommandBuilder(dapStaff)
Main.dgSearch.DataSource = ds.Tables("tblStaff")
Main.dgSearch.ReadOnly = True
i = ds.Tables("tblClaims").Rows.Count
Main.txtsearchcount.Text = "Found " & i & "Record(s)"
Private Sub dgSearch_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgSearch.CellClick
me.txtstaffFirstName.DataBindings.Add(New Binding("Text", ds, "tblStaff.FirstName"))
end sub
My cat's name is sprinkles
-Ralph Wigam
I have a datagrid i use for searching. When the user clicks the record they want I want the textbox to reflect the record selected. I want them to be bound so that I can call the adapters update method for minimal coding. I am sure I can code this the long way
I have bound the text box to the dataset but it only shows the first record I would have thought that it would disply they same data when changed as they are both bound to the same data set any way here is the code..also my row count doesn't work
dapStaff = New SqlDataAdapter(sQuery, cnn)
dapStaff.Fill(ds, "tblStaff")
bld1 = New SqlCommandBuilder(dapStaff)
Main.dgSearch.DataSource = ds.Tables("tblStaff")
Main.dgSearch.ReadOnly = True
i = ds.Tables("tblClaims").Rows.Count
Main.txtsearchcount.Text = "Found " & i & "Record(s)"
Private Sub dgSearch_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgSearch.CellClick
me.txtstaffFirstName.DataBindings.Add(New Binding("Text", ds, "tblStaff.FirstName"))
end sub
My cat's name is sprinkles
-Ralph Wigam