Results 1 to 4 of 4

Thread: VB.NET Multiple Statments

  1. #1
    Join Date
    Jun 2005
    Location
    Tunbridge Wells, Kent
    Posts
    203
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default VB.NET Multiple Statments

    in vb.net i came across a command that lets you run multiple SQL Select Statements, and run through the using only one DB connection...

    ie,

    codetoconnect(SELECT statement1; SELECT statement2; SELECT statement3)

    runthrough Statement1

    movenext

    runthrough Statement2

    movenext

    runthrough Statement3

    Disconnect



    what is the line that is my 'movenext' I can't refind the code!! Grr.

  2. #2
    Join Date
    Jun 2005
    Posts
    1,080
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    The line movenext should be to move to the next RecordSet and would depend on how you are reading the data from the database.

  3. #3
    Join Date
    Jun 2005
    Location
    Tunbridge Wells, Kent
    Posts
    203
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default

    If anyone is interested, I refound what I lost!

    if you perfrom a multiple select in one fetch from the database (ie, "SELECT * FROM table_a; select * FROM table_b")

    then! you can use dbread.NextResult() (substitute dbread for your connection)

    what's so good? you only need to perform one database connect, if using datareader than obviously you will stay connected to the database, but you can also use it for datasets if you have a more advanced DAL setup.

  4. #4
    Join Date
    Jan 2006
    Posts
    419
    Thanks
    2
    Thanked 16 Times in 16 Posts

    Default

    Are you using sql server, if so have you thought about doing the same thing using a stored procedure.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiple Table Query
    By spire128 in forum MSSQL
    Replies: 6
    Last Post: 20th October 2006, 05:21 PM
  2. Complex problem with multiple web site under same web (for Warren)
    By Warren Ashcroft in forum General Technical Support
    Replies: 1
    Last Post: 19th October 2006, 11:58 AM
  3. Multiple Users Inserting Data
    By s80wkr in forum ASP (VBScript)
    Replies: 4
    Last Post: 24th February 2006, 04:24 PM
  4. Multiple Users in Outlook 2003
    By jaimalchohan in forum General Technical Support
    Replies: 5
    Last Post: 14th December 2005, 11:49 AM
  5. Multiple dates
    By s80wkr in forum ASP (VBScript)
    Replies: 8
    Last Post: 18th October 2005, 12:20 PM

Bookmarks

Posting Permissions

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