本文介绍了这里的账单号码在10点后没有增加。请帮忙!!紧急!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private void cashreciept_Load(object sender, EventArgs e)
{
SqlDataAdapter da = new SqlDataAdapter("SELECT TOP 1 [Bill No] FROM cashreceipt ORDER BY [Bill No] DESC", sq.connection());
DataTable dt1 = new DataTable();
da.Fill(dt1);
if (dt1.Rows.Count > 0)
{
billno = Convert.ToInt32(dt1.Rows[0][0]);
billno +=1;
txtbill.Text = billno.ToString();
}
else
{
string h = "1/1/1911";
string c = "insert into cashreceipt values('" + 0 + "','" + 0 + "','" + 0 + "','" + 0 + "','" + 0 + "','" + 0 + "','" + h + "')";
SqlCommand ccmd = new SqlCommand(c, sq.connection());
ccmd.ExecuteNonQuery();
SqlDataAdapter da1 = new SqlDataAdapter("SELECT TOP 1 [Bill No] FROM cashreceipt ORDER BY [Bill No] DESC", sq.connection());
DataTable dt2 = new DataTable();
da1.Fill(dt2);
if (dt2.Rows.Count > 0)
{
billno = Convert.ToInt32(dt2.Rows[0][0]);
billno = billno+1;
txtbill.Text = billno.ToString();
}
}
}
推荐答案
9
8
7
6
5
4
3
2
11
10
1
这篇关于这里的账单号码在10点后没有增加。请帮忙!!紧急!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!