Results 1 to 4 of 4

Thread: [RESOLVED] [2008] Ado.net

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2008
    Posts
    22

    Resolved [RESOLVED] [2008] Ado.net

    What is the VB 2008 syntax for Recordset.recordcount (VB 6) ?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Ado.net

    Well, if you're not using a Recordset then there is no equivalent syntax. If you are using a Recordset then it would be the same. If you have a DataTable then it has a Rows collection and, just like every collection, it has a Count property. If you're getting your data from a DataReader then there is no way to know how many records are available until you've read them all.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2008
    Posts
    22

    Re: [2008] Ado.net

    Well I understand what you said but I don't know the syntax in VB2008. Can you please provide me with a sample code to enable me to understand total usage of recordset in VB 2008.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Ado.net

    Recordsets are not part of ADO.NET. They are ADO, which you can use in VB.NET but you shouldn't. You should follow the Data Access link in my signature for some ADO.NET code examples. You first need to decide exactly how to access your data. If you decide to populate a DataTable I've already told you how to get the record count: from its Rows.Count property. If you want to "understand total usage" of the DataTable class then I suggest that you read the documentation for that class. If you have a specific issue with its usage then by al means post a question but this forum is not a substitute for the reference material you already.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width