GIVE ME CODE
Auto Check Value
GIVE ME CODE
Auto Check Value
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Md SarfarajPosted Sep 11, 2021, 4:10 AM
Guest UserPosted Sep 12, 2021, 5:20 PM
void AutoSn()
{
try
{
SqlDataAdapter adapter = new SqlDataAdapter("SELECT SN FROM CHARGES", connection.getDatabaseConnection());
DataSet DS = new DataSet();
adapter.Fill(DS);
if (DS.Tables[0].Rows.Count > 0)
{
int Proid = int.Parse(DS.Tables[0].Rows[0]["SN"].ToString()) + 1;
CSN = Proid.ToString("1");
}
else if (Convert.IsDBNull(DS.Tables[0]))
{
CSN = "1";
}
else
{
CSN = "1";
}
drp_Serail.Text = CSN.ToString();
}
catch(Exception EX)
{
MessageBox.Show("ERROR" + EX);
}
}