title: Return value of sql query to textbox in C#
body: <p>I want to access the last value in database column increment it by 1 and show on a textbox
  I used this code but nothing is displayed on text box what's wrong with this code?</p>
  
  <pre><code>SqlCommand cmd = new SqlCommand("SELECT (MAX[Account_No]  FROM addcustomer ", my);
  
  int result = ((int)cmd.ExecuteScalar());
  textBox1.Text = result.ToString();
  </code></pre>