473,320 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Recordcount in vb.net

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
1 17353
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mark Watkins | last post by:
I know for a fact that in my database, I have three records under the users table. However when I execute this code: --------------BEGIN CODE---------------- Set objConn =...
2
by: Jeff Boyer | last post by:
Hello everyone, Can someone tell me why a ADO recordset.recordcount would return a -1? I have confirmed that it has records in it by writing some values to the screen. Why can't I count the...
12
by: scott | last post by:
In LISTING 2, I have a SPROC that returns a recordset and a recordcount in SQL QA. I can access the Recordset with no problem. How can I grab the Recordcount with ASP code at the same time I'm...
2
by: nick_faye | last post by:
why does my recordcount returns the # of actual records + 1? btw, i am using ms access. i don't know what happened but at first, my table seems ok. the recordcount returns the correct # of...
1
by: JMCN | last post by:
hello- i have created a tabular form using records from a specific query. then users will filter out the specific data. the next step is to take the count of the current records (daily open...
4
by: don.fleming | last post by:
Hi folks: Am doing a VBA SQL Select stmt with multiple rows found and not getting RecordCount > 1. I've verified there are multiple rows found by copying my SQL stmt from Debug window and pasting...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
2
by: rajvbprogramer | last post by:
here is my problem. i have two records. one containing 20 records and second containing 30 records. now i want the recordcount property to use and go to the 21 record. i m calculating the...
1
by: qqmbers | last post by:
May be it will help someone. I faced the strange problem with RecordCount property of cloned Recordset within the Current event handler. The RecordCount value was correct every time I had...
3
by: sparks | last post by:
Is recordcount a little messed or what? For Each tdf In dbs.TableDefs If Left(tdf.Name, 3) = "tbl" Then Debug.Print tdf.Name Debug.Print tdf.RecordCount it prints the correct name but the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.