new SqlParameter("@id",model.id)和 new SqlParameter("Id",model.id)有什么区别?string sql = "Insert Into [tb_User](id,name) Values(@id,@name) ;";SqlParameter[] sp = new SqlParameter[]\x05{new SqlParameter("@id",model.id),new SqlParameter("@name",
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 19:01:37
new SqlParameter("@id",model.id)和 new SqlParameter("Id",model.id)有什么区别?string sql = "Insert Into [tb_User](id,name) Values(@id,@name) ;";SqlParameter[] sp = new SqlParameter[]\x05{new SqlParameter("@id",model.id),new SqlParameter("@name",
new SqlParameter("@id",model.id)和 new SqlParameter("Id",model.id)有什么区别?
string sql = "Insert Into [tb_User](id,name) Values(@id,@name) ;";
SqlParameter[] sp = new SqlParameter[]
\x05{
new SqlParameter("@id",model.id),
new SqlParameter("@name",model.name)
}
与 传参改成 new SqlParameter("id",model.id),
new SqlParameter("name",model.name)有什么区别?注意@!
new SqlParameter("@id",model.id)和 new SqlParameter("Id",model.id)有什么区别?string sql = "Insert Into [tb_User](id,name) Values(@id,@name) ;";SqlParameter[] sp = new SqlParameter[]\x05{new SqlParameter("@id",model.id),new SqlParameter("@name",
@ID 是参数值
好比 select * from users where id=@ID
你传参数
SqlParameter[] parameters = {new SqlParameter("@ID",SqlDbType.Int,4)};
parameters[0].Value = ID;此ID 是变量传值给@ID