Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for records (Windows Form) 1

Status
Not open for further replies.

stfarm

Programmer
May 31, 2001
179
0
0
CA
Hi everybody,

this must be a silly question, but I can't remember (or find) how to check if my qry retrieved any records.

Where and how can I check for that? Any suggestions is greatly appreciated.

Here is some of my code:

Dim DS As New DataSet
Dim Conn = New OdbcConnection(DB2 + UID + ";pwd=" + gsPWD + ";")
Conn.Open()

Dim query As String = "select * from table where field =" & TextBox2.Text

Dim DA As New OdbcDataAdapter
DA.SelectCommand = New OdbcCommand(query, Conn)
Try
DA.Fill(DS, "TA1")

Catch ex As Exception
MsgBox(ex.ToString)

End Try
TextBox1.DataBindings.Clear()
TextBox1.DataBindings.Add(New Binding("Text", DS, "TA1.VNDR_BUS_NO"))
Conn.close()

Thank you very much,

Steve
 
Check the Rows.Count property of the first table in the DataSet.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top