Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2003
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP.NET Filling Dataset

    I need to fill a dataset with multiple resultsets. I found online examples like this -
    SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM customers;" + "SELECT * FROM products", connectionString);
    da.Fill(ds,"MyTable");

    But they all have been written in C# for SQL Server.
    When I try it in VB.NET using OleDB -

    OleDBDataAdapter da = new OleDBDataAdapter("SELECT * FROM customers;" + "SELECT * FROM products", connectionString)
    da.Fill(ds,"MyTable")

    I get an error "Characters found after the end of the SQL statement"
    Does anybody know how to make it working? Thanks

  • #2
    Regular Coder
    Join Date
    Jul 2004
    Location
    France
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if u r using access 2 SELECT will not work

    to be shure of what you are doing try >

    Dim Query As string = "SELECT * FROM customers;" + "SELECT * FROM products"

    Throw new Exception(Query)

    OleDBDataAdapter da = new OleDBDataAdapter(Query, connectionString)
    da.Fill(ds,"MyTable")

    then copy paste exactly the thrown Query in your Database and you will see


    the problem comes from 1 select after another one

    you coould fill your dataset with a for each Query as string in Queries ....

  • #3
    New Coder
    Join Date
    Jun 2003
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks gwendaal
    Last edited by esb01; 01-10-2005 at 05:53 PM.


  •  

    Posting Permissions

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