2
Reply

How to delete bill number auto Increment in windows APP. C#

Jyoti Jodha

Jyoti Jodha

Jan 8 2018 2:10 AM
147
How to delete bill number auto Increment
 
Suppose I Have 50 Bill Total and I delete bill number 10 to 25. Now when creating new bill number
 
Bill Number 10 and then complete 25 bills
 
After create new bill 51 number
 
int Billno = billno("Select ISNULL(Max(Billno+1),1) From BillForm
 
private int billno(string p)
{
Int32 Billno = 0;
//s = Billno;
cmd = new SqlCommand(p, con);
int k;
con.Open();
if (txtbill.Text != "")
{
Billno = Convert.ToInt32(txtbill.Text);
k = Billno;
s = k;
k = (Int32)cmd.ExecuteScalar();
con.Close();
return Billno;
}
else
{
Billno = s;
Billno = (Int32)cmd.ExecuteScalar();
con.Close();
return Billno;
}
}

Upload Source Code  Select only zip and rar file.
Answers (2)