asp.net存储过程输出参数的值
stringsqlConn=System.Configuration.ConfigurationManager.AppSettings["connectionString...
string sqlConn = System.Configuration.ConfigurationManager.AppSettings["connectionStrings"].ToString();
SqlConnection conn = new SqlConnection(sqlConn);
SqlCommand cmd = new SqlCommand("Reguser_Validate", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@username", txtUserId);
cmd.Parameters.AddWithValue("@pwd", txtPwd);
cmd.Parameters.AddWithValue("@result", 0);
cmd.Parameters.AddWithValue("@flag", flag);
cmd.Parameters["@result"].Direction = ParameterDirection.Output;
try
{
conn.Open();
cmd.ExecuteNonQuery();
intResult = Convert.ToInt32(cmd.Parameters["@result"].Value);
return true;
} 中i输出参数result是如何得到值的 展开
SqlConnection conn = new SqlConnection(sqlConn);
SqlCommand cmd = new SqlCommand("Reguser_Validate", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@username", txtUserId);
cmd.Parameters.AddWithValue("@pwd", txtPwd);
cmd.Parameters.AddWithValue("@result", 0);
cmd.Parameters.AddWithValue("@flag", flag);
cmd.Parameters["@result"].Direction = ParameterDirection.Output;
try
{
conn.Open();
cmd.ExecuteNonQuery();
intResult = Convert.ToInt32(cmd.Parameters["@result"].Value);
return true;
} 中i输出参数result是如何得到值的 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询