Hello everyone.
I'e got a same problem with a bit different in coding.
I should receive some values which are sent by Sql stored procedures as output parameters. In fact, I've done this in Windows application by SqlHelper class and thought both of them (in win & web) have to be same. However after running Sqlhelper methods (executenonequery, executescaler) nothing can be returned into Web Form.
I couldn't understand why is wrong?
Following code snippet shows you the way that I used:
SqlParameter[] Params = new SqlParameter[2];
Params[0] = new SqlParameter("@RoleId", RoleId);
Params[1] = SqlParameter("@return, "");
Params[0] = SqlParameter.Direction.InputOutput;
Params[1] = SqlParameter.Direction.Output;
// Execute
SqlHelper.ExecuteNonQuery(Connection, CommandType.StoredProcedure, "ManageRoles", Params);
// Retrieve Value
int Role = Convert.ToInt32(Params[0]. Value.ToString());
string result = Params[1].Value.ToString();
Any suggestion to solve this problem would be truly appreciated.
- Thanks.