Z
Zahid
Hi,
Im writing an SQL piece of code that throws an exception
if the value im passing in the SQL Query doesnt exist (ie
when serching the database table the value doesnt exist
in database table).
What I want to do is get a 0 returned to indicate to me
that it does not exist in database table without the
exception being thrown.
Any ideas how to do that? My code is below:
gMyCommand.CommandText =
"Select link from listHdrs where listNo = " & gListMenu
gRdr = gMyCommand.ExecuteReader
gRdr.Read()
gListMenuLink = gRdr.GetInt32(0)
gRdr.Close()
Thanks in advace.
Im writing an SQL piece of code that throws an exception
if the value im passing in the SQL Query doesnt exist (ie
when serching the database table the value doesnt exist
in database table).
What I want to do is get a 0 returned to indicate to me
that it does not exist in database table without the
exception being thrown.
Any ideas how to do that? My code is below:
gMyCommand.CommandText =
"Select link from listHdrs where listNo = " & gListMenu
gRdr = gMyCommand.ExecuteReader
gRdr.Read()
gListMenuLink = gRdr.GetInt32(0)
gRdr.Close()
Thanks in advace.