string find = "select max(DC_No) from IBS_DC_DTLS";
SqlCommand findquery = new SqlCommand(find, con);
SqlDataReader dr = findquery.ExecuteReader();
if (dr.Read())
{
string s = dr[0].ToString();
if (s != "")
{
int ss = Convert.ToInt32(s);
int sss = ss + 1;
string sd = Convert.ToString(sss);
txtDcno.Text = sd;
}
else
{
txtDcno.Text = "1";
}
}
No comments:
Post a Comment