Results 1 to 4 of 4

Thread: Record pointer...

  1. #1

    Thread Starter
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Question Record pointer...

    Hello...

    I guess the record's movement is such a simple stuff to do. But I couldn't find it in C# so far.

    Someone can tell me on how to move a record in C# ?
    (such as movefirst, movenext, movelast, moveprevious) ???

    Cos, as far as I learned this C# for the last 1 week, I only know "datareader.read()" to move record from the beginning to the EOF.

    Thanks....
    Regards,
    [-w-]

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

    Re: Record pointer...

    There are no such methods with a DataReader. The idea of the DataReader is that you read each record in turn from first to last.

    If you want random access to data then you get it all into a local store first, which will normally be a DataTable. You would do that by calling the DataTable's Load method and passing a DataReader or else calling the Fill method of a DataAdapter. You can then access any field of any record you like. Navigating a DataTable has no meaning. If the DataTable is bound to UI controls, then the user can navigate the data they are viewing. You can use a BindingNavigator to provide that functionality to the user.
    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
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Re: Record pointer...

    hmmm...
    do u mind giving me a simple sample on how to do this ?
    I really a newbie on this language.

    Thanks
    Regards,
    [-w-]

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

    Re: Record pointer...

    I strongly suggest working through one or more ADO.NET tutorials.

    http://www.google.com.au/search?q=%2...ient=firefox-a
    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