Saturday, August 11, 2018

Autogenerate ID Concept


Button Click Event   

public void AutogenId()
    {
        Int32 ap = 5001;
        try
        {
            cm = new SqlCommand("Select max(roll)+1 from Table1", cn);
            ap = (Int32)cm.ExecuteScalar();
            Label1.Text = ap.ToString();
        }
        catch (Exception)
        {
            Label1.Text = ap.ToString();
        }

No comments:

Post a Comment

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...