hi all,
i m a newer in c#. a already start to using c# today.
in my first project i make program to add,edit and delete data from database.
i m already do all of them. now i want to showing data in every control (textbox,combobox, etc) when i click datagrid.
i want to specify the row that it use as key to binding data, but i dont have any idea for this. does anybody know how to get value from datagrid??
i m using this following code in vb.net. please give a code in c#.net
Dim i As New integer
i = dgGuru.CurrentRowIndex()
cmdGuru = cnn.CreateCommand
cmdGuru.CommandText = "SELECT * FROM PedidikanGuru where NIP ='" + Trim(dgGuru.Item(i, 0)) + "'"
Trim(dgGuru.Item(i, 0)) -> this code will get the value from coloumn 0 and row i (agree with which row i was clicked)
No | Name |
----|------------|
1 |- Jx -|
2 |- Man -|
so ex, if i click row one i will get my textbox1 = 1 and textbox2 = jx.
Please Help me...
Best Regards