G
Guest
How do I capture the data in a primary key?
strsql="select nameID,fname from tblname where fname = '" & txtFname.text &
"' and lname = '" & txtlname.text & "'"
objOleDBCommand.CommandText = strsql
objoledbreader = objOleDbCommand.ExecuteReader()
intname = objoledbreader.item("nameID")
error "No data exists for the row/column
I go to the tblname on sql server and there is data in table when above
query is run with appropriate names.
I have tried intname =
objoledbreader.getstring(objoledbreader.getordinal("nameID"))
no data returned.
I need the number of the primary key to insert in a related table as a
foreign key.
strsql="select nameID,fname from tblname where fname = '" & txtFname.text &
"' and lname = '" & txtlname.text & "'"
objOleDBCommand.CommandText = strsql
objoledbreader = objOleDbCommand.ExecuteReader()
intname = objoledbreader.item("nameID")
error "No data exists for the row/column
I go to the tblname on sql server and there is data in table when above
query is run with appropriate names.
I have tried intname =
objoledbreader.getstring(objoledbreader.getordinal("nameID"))
no data returned.
I need the number of the primary key to insert in a related table as a
foreign key.