title: C#: How to get data from the last row in database? I'm using in visual studio 2017
body: <p>Need help in C# ( Visual Studio 2017 )</p>
  
  <p>I want to get a data from my database from the last row or last inputted data.
  My code is here..</p>
  
  <pre><code>            String query = "SELECT TOP(1) MessageNumber FROM ncslbpHighWay";
              SqlCommand SDA = new SqlCommand(query, AR);
  
              SqlDataReader data = SDA.ExecuteReader();
              if (data.Read())
              {
                  textBox2.Text = data.GetValue(0).ToString();
              }
              AR.Close();
  </code></pre>
  
  <p>I already got the data but from the specific column at the top only. I don't know how to get the bottom value.
  Also i tried the <code>DESC</code> but it doesn't work.</p>
  
  <p><code>String query = "SELECT TOP(1) MessageNumber FROM ncslbpHighWay ORDER BY COLUMN DESC";</code></p>
  
  <p>This is my first question here in Stackoverflow. I hope someone would help me on this. </p>