Multiple datasets - am I doing this right?
Posted on 2006-03-30
I need to execute two stored procedures and create two datasets.
This is what I have done so far, I'm not getting any errors, but wanted to now if I am doing this "right".
connection = New SqlConnection(ConfigurationManager.ConnectionStrings("WachoviaConnectionString1").ConnectionString)
'Initialize the command
netPayCommand = New SqlCommand("NetPay", connection)
'Mark the command as stored procedure
netPayCommand.CommandType = CommandType.StoredProcedure
da = New SqlDataAdapter(netPayCommand)
ds = New DataSet
'Fill data dataset
expensesCommand = New SqlCommand("MonthlyExpenses", connection)
expensesCommand.CommandType = CommandType.StoredProcedure
da = New SqlDataAdapter(expensesCommand)