com = New SqlCommand("SELECT Max(Mobile_Id) FROM Mobile UNION SELECT MAX(Mobile_Id) FROM DeleteMobile", con) con.Open() com.ExecuteNonQuery() If IsDBNull(com.ExecuteScalar) Then InsertMobile.TextBox1.Text = "" InsertMobile.TextBox1.Text = 1 Else InsertMobile.TextBox1.Text = "" InsertMobile.TextBox1.Text = com.ExecuteScalar + 1 End If con.Close()
SELECT MAX(a.Mobile_Id) FROM (SELECT Max(b.Mobile_Id) AS Mobile_Id FROM Mobile b UNION SELECT MAX(c.Mobile_Id) AS Mobile_Id FROM DeleteMobile c) a
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)