By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

Recordcount in vb.net

P: n/a
iam usualy use this statement in vb6

Rs.Open "Select * from myTable",Con,1,3
If Rs.Recordcount =0 then
msgbox "Table Empty"
else
msgbox "Total record are : " & Rs.Recordcount
endif

Does any know how to do that in vb.net with ado.net

Thanks
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Geon,

Assuming you have a table inside a dataset, thus:

Dim daprod As New SqlDataAdapter("select * from prod where
substring(issuecode,1,6) >= '200204' and pubcode = '003' order by title",
oconn)

Dim dsprod As New DataSet("prod")

daprod.Fill(dsprod, "prod")

dim i as integer

i = dsprod.tables(0).rows.count

HTH,

Bernie Yaeger
"Goen" <ps******@indosat.net.id> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl...
iam usualy use this statement in vb6

Rs.Open "Select * from myTable",Con,1,3
If Rs.Recordcount =0 then
msgbox "Table Empty"
else
msgbox "Total record are : " & Rs.Recordcount
endif

Does any know how to do that in vb.net with ado.net

Thanks

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.