hi man
do you want to know about selected row value from paricular column in datagridview and store that values into ur combobox ?
Or get combobox values and load into datagridview in particular column? Can you send ur code or send ur problem clearly?
anyway here is answer for first question
'Here put ur DBconnection
'I use con, cmd,dr, dt as object of sqlconnection,command,
'sqldatadapter,datatable you can as you declared object
'example: design form with Two text boxes, one combobox in combobox you 'can store the Course of the student
- In Grid Selection Changed Event you write this code
-
dr = New SqlDataAdapter("Select * from student where Studentid = " &
-
givenid & " ", con)
-
dr.Fill(dt)
-
If dt.Rows.Count > 0 Then
-
txtStudentid.Text = dt.Rows.Item(0).Item("Studentid")
-
txtFname.Text = dt.Rows.Item(0).Item("Fname")
-
ComboBox1.SelectedItem = dt.Rows.Item(0).Item("Course")
-
End if
-
-
-
'While you run the formload event you load combox values also
'by same way use above code to select course from student table and 'assign it to combobox.
'Then it run smartly