Skip to content

Show me the very last number by ORDER

Cefora Kaja

Asked Oct 26, 2015, 8:35 AM EDT3 answers
Share
LinkedInX
Hi!
I have a small table with three column: ID, Name and number
Then in the number column there is numbers that its not in order (for example: 1,2,7,5,3, etc.)
When I make my search I wish that this filter should be do in order. For instance if the column Name = 'shana' then show me ONLY the very last number of shana into my textbox.
With these codes its works but its show me the first number (or other anynumber) of the person I need. But my concern is to show the last number in order. This is the error message: Erro of sintaxe in expression of query 'number where name='Shana''.

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Lets see my codes:
    Code
    string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\hello\App_Data\test.mdb;Persist Security Info=False";
    OleDbConnection sqlCon = new OleDbConnection(connectionString);
    sqlCon.Open();
    0
  • 0
    Java
    string commandString = "select * from company ORDER BY where name='" + textBox1.Text + "'";
    OleDbCommand sqlCmd = new OleDbCommand(commandString, sqlCon);
    OleDbDataReader read = sqlCmd.ExecuteReader();
    0
  • 0
    Excuse me to send my code in piece. I could not send the whole once. The site doesnt allow mw to send the whole. I dont know what happen.
    0