.net编程(自动生成会员卡号)

///
/// 自动生成会员卡号
///
void CardNumber()
{
string sql = string.Format("select top 1 cardId from cardInfo order by cardId desc");
DBHelper.cmd = new SqlCommand(sql, DBHelper.conn);
DBHelper.conn.Open();
int id = Convert.ToInt32(DBHelper.cmd.ExecuteScalar());
DBHelper.conn.Close();
string number = string.Format("023-{0:D3}", id + 1);
txtCardNumber.Text = number;
}
【.net编程(自动生成会员卡号)】转载于:https://www.cnblogs.com/Miss-Lee/p/3888137.html

    推荐阅读