变量名 '@strName' 已声明。变量名在查询批次或存储过程内部必须唯一。 必须声明标量变量 "@strPwd"。
stringstr=ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionStr...
string str = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
using (SqlConnection conn = new SqlConnection(str))
{
conn.Open();
string strSql ="insert into MemberUser_Info(MemberGuid,MemberName,MemberPwd)values(@strGuid,@strName,@strPwd)";
SqlCommand comm = new SqlCommand(strSql,conn);
comm.Parameters.Add(new SqlParameter("@strGuid", strGuid));
comm.Parameters.Add(new SqlParameter("@strName",strName));
comm.Parameters.Add(new SqlParameter("@strName",strPwd));
return comm.ExecuteNonQuery();
} 展开
using (SqlConnection conn = new SqlConnection(str))
{
conn.Open();
string strSql ="insert into MemberUser_Info(MemberGuid,MemberName,MemberPwd)values(@strGuid,@strName,@strPwd)";
SqlCommand comm = new SqlCommand(strSql,conn);
comm.Parameters.Add(new SqlParameter("@strGuid", strGuid));
comm.Parameters.Add(new SqlParameter("@strName",strName));
comm.Parameters.Add(new SqlParameter("@strName",strPwd));
return comm.ExecuteNonQuery();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询