N
Nikolay Petrov
How to fill DataSet from stored procedure?
How to fill DataSet from stored procedure?
Jeff Johnson said:Create a xxxCommand object around the stored procedure and then use that
object when creating the xxxDataAdapter.
Air code:
Dim cnn As SqlConnection = New SqlConnection("Data Source=MySrv;Initial
Catalog=MyDB;Integrated Security=SSPI")
cnn.Open()
Dim cmd As SqlCommand = New SqlCommand("MySP", cnn)
cmd.CommandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet
da.Fill(ds, "MyTable")
Maybe my question was wrong.
I needed to know does any data will be returned from stored procedure select
statment to dataset.
I mean when the sqlcommand.commandType is text and .CommandText is the SQL
statemen everything works ok, but when the same sql statment is in stored
procedure does the DataSet iss filled properly?