Forum Moderators: open
The error is:
@portTypeID is not a parameter for procedure sp_FindPortfolioByType
Here is the code:
settingID = 1;
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand cmd = new SqlCommand("sp_FindPortfolioByType", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter portTypeID = new SqlParameter("@portTypeID", System.Data.SqlDbType.Int, 4);
portTypeID.Value = settingID;
portTypeID.Direction = ParameterDirection.Input;
cmd.Parameters.Add(portTypeID);
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
Thanks
Consider using the Microsoft Data Access Block for your data access routines. It is far simpler to use than writing directly against the SqlProvider. Source code is provided with the library, so you can modify it for your own needs.
[msdn.microsoft.com...]
WDSF