i cant get your point , i think you want to select all records from persons table of selected person id in grid , if i am wrong then please correct me , well for simple select case you can do like this
dim myCmd as string
myCmd = "select * from persons where personID=" val(datagridview1.item("Personid",datagridview1.currentrow.index).value.tostring)'you can use index of your column in place of "personid".
this will select all the records from the table persons of selected personid
in above code we use selected value from the cell of the grid to get all the records of that selected value ,now what is your question please rephrase it .so that i can help you in better and effective way
my gridview is combined by 2 tables and the id of both isn't on the gridview i want to get the selected row of the gridview to select the row on table1
so your solution didn't work because the id is not on the gridview
i solved it by placing the id on the gridview and seting the visible property to false
i dont know which fields you are taking in grid , lets consider if there is a table name student , having ids , stuid , stuname , stufathername ,stuphonno, now you are showing stuname , stufathername,stuphone in grid and want to do same as you mentioned above then you can write this code for selection.
dim myCmd as string
myCmd = "select * from persons where stuname='"datagridview1.item("StuName",datagridview1.currentrow.index).value.tostring &"' and stufathername= '"& datagridview1.item("stufathername",datagridview1.currentrow.index).value.tostring&"' and stuphoneno='"&val(datagridview1.item("stuphone",datagridview1.currentrow.index).value.tostring &"'"
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...