/// <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);
}
转载于:https://www.cnblogs.com/silverLee/archive/2009/11/05/1596508.html