get other columns from base on selected row in dbgrid

ssfftt

Well-known member
Joined
Oct 27, 2005
Messages
163
Programming Experience
1-3
[solved]get other columns from base on selected row in dbgrid

i have a dbgrid with databinding to mssql db table "RESULTS", the dbgrid displays all results that belong to currrent logged in user. the select sql is:
VB.NET:
SELECT RESULT.STARTTIME, RESULT.ENDTIME, RESULT.TOTALMARKS, RESULT.GRADE
FROM  TEST INNER JOIN RESULT ON TEST.TID = RESULT.TID INNER JOIN CYMUSER ON TEST.UID = CYMUSER.UID AND RESULT.UID = CYMUSER.UID
WHERE  (TEST.TNAME = @TNAME) AND (CYMUSER.UNAME = @UNAME)
RID is the pk of table RESULTS, but not displayed in the dbgrid.i have a button "giveRID", now i select a row in the dbgrid, when i click on the button "giveRID", i want the program to figure out the value of RID for selected row. can anyone help me on code plz?
 
Last edited:
alright, done, dont worry ppl, all fixed in a silly way:
1) put the pk in datagrid
2) hide the pk column
3) DataGridCompareResults.Item(DataGridCompareResults.CurrentRowIndex, 4)
hope ppl having same trouble can learn from me, thx for those trying to help
 
Back
Top