You are not using any "
Order By
" clause in your query. So, the database server is returning the result set in an order which is not having the same order shown in the database table.
Most probably, using an "
Order by UserId (Or, Primary key field)
" would solve this issue, but, I would recommend you to add a "
Where
" filter to your query if you need to load a specific user from the database. For example:
SELECT UserId from Users WHERE UserId = 1