Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting Results from Stored Procedure
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01412039
Message ID:
01412061
Vues:
47
Great you figured this out.

>Excellent, Naomi, thanks. That was just the info I needed. So here's my function that works great:
>
>
> public DataSet getPurchases(int iContactId)
>        {
>
>            String cConnectionString = this.DataAccessObject.ConnectionString;
>            SqlConnection sqlConn = new SqlConnection(cConnectionString);
>            System.Data.SqlClient.SqlCommand cmdPurchasesForContact = new SqlCommand("dbo.getPurchasesForContact", sqlConn);
>			cmdPurchasesForContact.CommandType = System.Data.CommandType.StoredProcedure;
>			cmdPurchasesForContact.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
>				new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((byte)(0)), ((byte)(0)), "", System.Data.DataRowVersion.Current, null),
>				new System.Data.SqlClient.SqlParameter("@iContactId", System.Data.SqlDbType.Int, 0, "iContactId")});
>
>
>            DataSet ds = new DataSet();
>            SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter();
>            da.SelectCommand = cmdPurchasesForContact;
>            da.Fill(ds, "crsPurchases");
>            return ds;
>        }
>
>
>>
>>However, in MM there should be a method already to get the connection string.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform