return value of sql querry
SqlCommand cmd = new SqlCommand("SELECT (MAX[Account_No] + 1) FROM addcustomer ", my);
cmd.ExecuteScalar();
int result = ((int)cmd.ExecuteScalar());
textBox1.Text =Convert.ToString( result);
i want to save the return value of this query in a integer like abve but nothing displayed on textbox.