G
Guest
Hi,
I'm sure this has been answerd before somewhere and i'm just not
searching on the right keywords, so could someone point me in the
right direction?
I'm using .NET 1.1 and the Enterprise Library June 2005 to build a web
application. The application has numerous drop down list controls for
the user to make their selections through and I thought it would be a
good idea to base these on DataTables held within a DataSet populated
from a Stored Procedure. (If this concept is wrong then stop me at
this point and educate me please!)
The problem I seem to be having is that I can't get the SP to populate
the DataSet.
He're some of my attempts:
Dim db As Database = DatabaseFactory.CreateDatabase("VideoClub")
Dim ds As DataSet = New DataSet
Dim dbc As DBCommandWrapper
' Attempt 1
dbc = db.GetStoredProcCommandWrapper("udpLists")
Call db.LoadDataSet(dbc, ds, "Genre") ' Failed
' Attempt 2
dbc = db.GetSqlStringCommandWrapper("SELECT * FROM tblMyTable")
Call db.LoadDataSet(dbc, ds, "Genre") ' Success
' Attempt 3
dbc = db.GetStoredProcCommandWrapper("udpLists")
ds = db.ExecuteDataSet(dbc) ' Failed
Return ds
Each attempt was run on its own and only the second version returned
any data. Unfortunately it uses hardcoded SQL and I don't like that
idea as I prefer to leave all data selection to SQL Server via SP's.
(again, if i'm off the mark here then please let me know!).
So assuming you've not already corrected me, how can I achieve my aim
of populating a DataSet from a SP? Any suggestions?
Cheers,
<M>
I'm sure this has been answerd before somewhere and i'm just not
searching on the right keywords, so could someone point me in the
right direction?
I'm using .NET 1.1 and the Enterprise Library June 2005 to build a web
application. The application has numerous drop down list controls for
the user to make their selections through and I thought it would be a
good idea to base these on DataTables held within a DataSet populated
from a Stored Procedure. (If this concept is wrong then stop me at
this point and educate me please!)
The problem I seem to be having is that I can't get the SP to populate
the DataSet.
He're some of my attempts:
Dim db As Database = DatabaseFactory.CreateDatabase("VideoClub")
Dim ds As DataSet = New DataSet
Dim dbc As DBCommandWrapper
' Attempt 1
dbc = db.GetStoredProcCommandWrapper("udpLists")
Call db.LoadDataSet(dbc, ds, "Genre") ' Failed
' Attempt 2
dbc = db.GetSqlStringCommandWrapper("SELECT * FROM tblMyTable")
Call db.LoadDataSet(dbc, ds, "Genre") ' Success
' Attempt 3
dbc = db.GetStoredProcCommandWrapper("udpLists")
ds = db.ExecuteDataSet(dbc) ' Failed
Return ds
Each attempt was run on its own and only the second version returned
any data. Unfortunately it uses hardcoded SQL and I don't like that
idea as I prefer to leave all data selection to SQL Server via SP's.
(again, if i'm off the mark here then please let me know!).
So assuming you've not already corrected me, how can I achieve my aim
of populating a DataSet from a SP? Any suggestions?
Cheers,
<M>