Results 1 to 6 of 6

Thread: .NET Class and reading 1 record in SQL

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    .NET Class and reading 1 record in SQL

    Somewhat new to SQL and processing loops. I have a non-keyed file and I want to get the next record in sequence .. grab data needed and update it as used. This class is called from a GUI interface so I only need to grab the NEXT record each time......... how??

    gollnick
    William E Gollnick

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: .NET Class and reading 1 record in SQL

    What database? What constitutes the next record, are they ordered somehow?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: .NET Class and reading 1 record in SQL

    Sorry.. SQL table.... BingoCardStack sequential by serial number of card.
    GUI interface askes for next card in order to create card for printing. Record is marked as "used" (no problem there) but I only want 1 record.. I think it's datareader but looking for an example

    gollnick
    William E Gollnick

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: .NET Class and reading 1 record in SQL

    Show your sql statement and elaborate more on the record you want.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: .NET Class and reading 1 record in SQL

    That's the point .. I have no statement. That is what I/m looking for.

    My GUI interface calls a dataaccess class

    I want to do a select * to my bingocardstack file

    I then want to do an executereader

    I then want to read 1 record and fill a dataset to return to my GUI interface

    I then want to close the reader and the connection

    Just not sure of the correct syntex

    gollnick
    William E Gollnick

  6. #6
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: .NET Class and reading 1 record in SQL

    Well there are tons of examples for that.
    Are you familiar with data manipulation?
    If not, please do a little reading and you will probably get the solution in a couple of minutes.
    Here is a very basic example (i always keep the sp's,queries in my database but anayway...)
    http://www.startvbdotnet.com/ado/sqlserver.aspx
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

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