Index out of bounds error -- how to trap?

G

Guest

Greetings,

Dim dr as datarow

dr = ds.Table("tbl1").Select("RowID = " & txt1.Text")
If dr("RowID").ToString.Equals("123") Then...

if the RowID in txt1.Text does not exist in "tbl1" then I get the index out
of bounds error -- dr did not get a row - a row with that RowID does not
exist. How can I trap for this error?

Thanks,
Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top