MS Application Blocks question

amber

Member
Joined
Oct 27, 2004
Messages
20
Programming Experience
Beginner
I'm trying to populate a dataset that contains 2 tables, using MS Applications Blocks.
In my searches on the internet, it seems that populating 2 tables in a dataset is as simple as:


[size=+0]dataAdapter1.fill(dataset1("table1")
dataAdapter1.newSelectCommandHere
dataAdapter1.fill(dataset1("table2")
[/size]

But with the SQLHelper class, I don't seem to be able to specify which table to populate - my code is:

[size=+0]
Dim tables(1) As String
tables(0) = "table1"
tables(1) = "table2"


ds.Clear()

SqlHelper.FillDataset(SqlDbManager.GetConnectionString, CommandType.StoredProcedure, "StoredProcedure1", ds, tables, params)

[size=+0]SqlHelper.FillDataset(SqlDbManager.GetConnectionString,
CommandType.StoredProcedure, "StoredProcedure2", ds, tables, sqlPararameter1)
[/size]

My "Table1" fills fine - but "Table2" is always empty.


Any suggestions?
Thansk!
Amber



[/size]
 
MS App block - filling more than one table in a dataset

Yes, but if I specify a table
eg:
SqlHelper.FillDataset(SqlDbManager.GetConnectionString, CommandType.StoredProcedure, "StoredProcedure1", ds, tables(0), sqlParameter1)

I get an error. ("Overload resolution failed....")

That is my question...how do I specify a table to fill??

Amber
 
I must say I'm not all that farmiliar with DAAB, have you tried not specifying a table name? Normally tables will be added automatically and called table1, table2 etc.
 
MS App block - filling more than one table in a dataset

Well that is how I was doing it.
But only my first table was ever populating.
The 2nd table always remained empty.

I'm not sure where the problem lies, but I thought maybe it was when I called the SQLHelper class.

Amber
 
Back
Top