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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Md SarfarajRank #194 · 12.4K reputationPosted Sep 11, 2021, 12:10 AM EDT
Guest UserRank #1,881 · 787 reputationPosted Sep 12, 2021, 1:20 PM EDT
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);
}
}