...

View Full Version : ASP.NET Filling Dataset



esb01
01-10-2005, 03:54 AM
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

gwendaal
01-10-2005, 09:44 AM
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 ....

esb01
01-10-2005, 05:17 PM
Thanks gwendaal



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum