In VB6 there was a thing called a Recordset Object. I could start with a stored procedure which returned some columns and rows from a SELECT statement, and then get the .Items(X) from the Recordset in code.
I am trying the same thing in .NET but cant find a Recordset object or anything like it. I have seen alot of references to the Dataset, but nearly all the examples are binding it to GUI objects. Thats not what I want.
I have stored procs that return "recordsets". How can I get at them from VB.NET?
Here is how I am currently getting return values from SP to .NET:
VB Code:
Dim myGetInfoConnection As New SqlConnection(System.Environment.GetEnvironmentVariable("RhinoConnectionString")) Dim myGetInfoCommand As New SqlCommand("spIAS_GetImageFromOperation", myGetInfoConnection) ' ' Mark the Command as a SPROC myGetInfoCommand.CommandType = CommandType.StoredProcedure ' ' Add Parameters to SPROC prmRETURN_VALUE = myGetInfoCommand.Parameters.Add("@RETURN_VALUE", SqlDbType.Int) prmRETURN_VALUE.Direction = ParameterDirection.ReturnValue ' Dim prmOperationID As New SqlParameter("@operationID", SqlDbType.Int) prmOperationID.Value = m_OperationID myGetInfoCommand.Parameters.Add(prmOperationID) ' Try ' myGetInfoConnection.Open() myGetInfoCommand.ExecuteNonQuery() m_PictureID = myGetInfoCommand.Parameters(0).Value ' myGetInfoConnection.Close() ' Catch SQLexc As SqlException Response.Write("SP Failed. Error Details are: " & SQLexc.ToString()) End Try
Thanks!
Dave




Reply With Quote