You have not mentioned what database it is. If it is SQL Server (as you have used
SqlConnection
class) then, as digimanus suggested, rewrite your query as
SELECT TOP 1 * FROM [User]
There is no LIMIT clause in MS SQL Server.
If you database is indeed MySQL, then use the appropriate Library to access the database, you cannot use
SqlConnection
in that case.
And your try/catch code is horrible. If at all you use try/catch, use the catch block to log the actual exception message.