Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning Info From A SQL Proc
Message
De
04/10/2007 08:20:43
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
01258316
Message ID:
01258473
Vues:
11
If you are doing a fill, would it work to return two recordsets, one of which being your desired value?

>I have a SQL proc that accepts two params and returns a record and which also has an
>output parameter with an error state.
>
>Using C#, I need to return the record and the output parameter.
>
>So far, I have the following, but I'm not sure I'm going the right direction. Can anyone help?
>
>
>
>
>// Create and open a connection
>SqlConnection oConnection = new SqlConnection(oDBInfo.sConnString);
>oConnection.Open();
>
>// Set up a data adapter
>SqlDataAdapter oDataAdapter = new SqlDataAdapter("sp_MyProc", oConnection);
>oDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
>
>
>// Create a data set
>DataSet oDataSet = new DataSet("MyTable");
>
>// Fill the data set
>oDataAdapter.Fill(oDataSet);
>
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform