Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting Results from Stored Procedure
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01412039
Message ID:
01412061
Views:
48
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform