Simple "rowfind" question (I hope)

  • Thread starter Thread starter postings
  • Start date Start date
P

postings

Hi

A quick question....

Please take a look at this piece of code:

-----------------------------------
Dim rowfind As Mydataset.mydatarow
rowfind = Mydataset1.mytable.FindBymytableid(x)
-----------------------------------


All well and good then, but what if I can't find the row in the table
with value x?
How do I test for this situation in vb.net?

"If rowfind.IsNull Then" .... do something - doesn't work.

I've tried other combinations. The only way I've managed to do it so
far is to catch an exception, which is hardly ideal. Does anybody have
any idea of the syntax using this example?

Many thanks!

Alex
 
Hi Alex

What Data provider are you using that has mydataset, mytable and
mydatarow as classes?

MySQL?

Put a break on the "rowfind =" line. When you hit that line and it
can't find a row, what does the output of
"?rowfind=Mydataset1.mytable.FindBymytableid(x)" give you in the command
window?

Regards
Ray
 
Thanks Ray
I'm using MS SQL Server 2000.

Cheers

Alex
Hi Alex

What dataprovider are you using to connect to the SQL server

Did you have any luck with the debugging?

Regards
Ray
 
Hi,

Hi

A quick question....

Please take a look at this piece of code:

-----------------------------------
Dim rowfind As Mydataset.mydatarow
rowfind = Mydataset1.mytable.FindBymytableid(x)
-----------------------------------


All well and good then, but what if I can't find the row in the table
with value x?
How do I test for this situation in vb.net?

"If rowfind.IsNull Then" .... do something - doesn't work.

If Not (rowfind Is Nothing) Then
' found

Else
' not found

End If



HTH,
Greetings
 
Back
Top