R
Roy Lawson
I have created a stored procedure on SQL Server 2000 that I know
works. I then dragged the sqldataadapter control onto my form, and
connected to an existing stored procedure. My datasets and sqlcommand
objects were created for me by the designer.
I pass in this (I used the values in the strDTStart, strDTEnd, and
strCompany variables succesfully in my test, it returned desired
results):
SqlSelectCommand4.Parameters(1).Value = strDTStart
SqlSelectCommand4.Parameters(2).Value = strDTEnd
SqlSelectCommand4.Parameters(3).Value = strCompany
SqlSelectCommand5.Parameters(1).Value = strDTStart
SqlSelectCommand5.Parameters(2).Value = strDTEnd
SqlSelectCommand5.Parameters(3).Value = strCompany
'##############################
conDaily.Open()
SqlSelectCommand4.ExecuteNonQuery()
SqlSelectCommand5.ExecuteNonQuery()
daLaborBudgets.Fill(DsLaborBudgets1)
DailyRoomSales.Fill(DsBudgetRoomSales1) '<--
BudgetRoomSales.Fill(DsRoomSales1) '<--
con.Close()
'###############################
The problem is that my datasets come back with nothing in them. The
code executes without an exception, however I am not filling the
datasets with what I know should come back. The SelectCommand
property for DailyRoomSales and BudgetRoomSales are set to
SqlSelectCommand4 and SqlSelectCommand5. This is automagicly
generated by VS.
I have followed everything I could find on the other newsgroups and am
about to give up on the stored procedure route, and just connect
directly to the SQL view and do the math programigicly
Any ideas on this one before I ditch the stored procedure?
Thanks,
Roy
works. I then dragged the sqldataadapter control onto my form, and
connected to an existing stored procedure. My datasets and sqlcommand
objects were created for me by the designer.
I pass in this (I used the values in the strDTStart, strDTEnd, and
strCompany variables succesfully in my test, it returned desired
results):
SqlSelectCommand4.Parameters(1).Value = strDTStart
SqlSelectCommand4.Parameters(2).Value = strDTEnd
SqlSelectCommand4.Parameters(3).Value = strCompany
SqlSelectCommand5.Parameters(1).Value = strDTStart
SqlSelectCommand5.Parameters(2).Value = strDTEnd
SqlSelectCommand5.Parameters(3).Value = strCompany
'##############################
conDaily.Open()
SqlSelectCommand4.ExecuteNonQuery()
SqlSelectCommand5.ExecuteNonQuery()
daLaborBudgets.Fill(DsLaborBudgets1)
DailyRoomSales.Fill(DsBudgetRoomSales1) '<--
BudgetRoomSales.Fill(DsRoomSales1) '<--
con.Close()
'###############################
The problem is that my datasets come back with nothing in them. The
code executes without an exception, however I am not filling the
datasets with what I know should come back. The SelectCommand
property for DailyRoomSales and BudgetRoomSales are set to
SqlSelectCommand4 and SqlSelectCommand5. This is automagicly
generated by VS.
I have followed everything I could find on the other newsgroups and am
about to give up on the stored procedure route, and just connect
directly to the SQL view and do the math programigicly
Any ideas on this one before I ditch the stored procedure?
Thanks,
Roy