darenkov Posted February 20, 2005 Posted February 20, 2005 Hi, I have created a dataset which is populated with the results from my Stored Procedure and then bound to my datalist. Everything works fine but I am not sure how to get the Ouput Paramater back from my SPROC through my dataset or otherwise. I know it can be done with the command.executenonquery method but I am not using that as I am just using the fill method of the dataset to get my results. Is there anyway I can pull this out through my dataset or a different method (other than command.executenonquery ? Here is the relevant block of code containing the name of the output parameter: ------------------------------------------------------------ cmd.Parameters.Add("@FullCount", SqlDbType.Int) cmd.Parameters("@FullCount").Direction = ParameterDirection.Output Dim adapter As New SqlDataAdapter(cmd) Dim ds As New DataSet() adapter.Fill(ds) ListResults.DataSource = ds.Tables(0).DefaultView ListResults.DataBind() How can I get the @FullCount parameter into a variable? cheers Quote
Administrators PlausiblyDamp Posted February 20, 2005 Administrators Posted February 20, 2005 cmd.Parameters.Add("@FullCount", SqlDbType.Int) cmd.Parameters("@FullCount").Direction = ParameterDirection.Output Dim adapter As New SqlDataAdapter(cmd) Dim ds As New DataSet() adapter.Fill(ds) Dim i as integer = cmd.Parameters("@FullCount").Value should do it. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.