1个回答
展开全部
/// <summary>
/// 增加一条数据
/// </summary>
public void Add(.Model.Users model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into Users(");
strSql.Append("Uid,Uage,Uname)");
strSql.Append(" values (");
strSql.Append("@Uid,@Uage,@Uname)");
SqlParameter[] parameters = {
new SqlParameter("@Uid", SqlDbType.Int,4),
new SqlParameter("@Uage", SqlDbType.Int,4),
new SqlParameter("@Uname", SqlDbType.VarChar,50)};
parameters[0].Value = model.Uid;
parameters[1].Value = model.Uage;
parameters[2].Value = model.Uname;
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
/// 增加一条数据
/// </summary>
public void Add(.Model.Users model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into Users(");
strSql.Append("Uid,Uage,Uname)");
strSql.Append(" values (");
strSql.Append("@Uid,@Uage,@Uname)");
SqlParameter[] parameters = {
new SqlParameter("@Uid", SqlDbType.Int,4),
new SqlParameter("@Uage", SqlDbType.Int,4),
new SqlParameter("@Uname", SqlDbType.VarChar,50)};
parameters[0].Value = model.Uid;
parameters[1].Value = model.Uage;
parameters[2].Value = model.Uname;
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询