I am using C# and .NET 2.0. I created an OleDbDataAdapter to import a tab delimited file and in the SQL for one of my commands, I am adding 'LIMIT 1' to the end of the query.
string query = string.Format("SELECT DISTINCT *
FROM {0}
ORDER BY ZipCode
LIMIT 1", tableName);
I run the query and my program throws an exception, System.Data.OleDb.OleDbException: Syntax error (missing operator) in query expression 'ZipCode LIMIT 1'.
I am just running some tests now but I'm curious as to why it does not work or if there is an alternate way to limit the amount of rows returned. I am working with files that have tens of thousands of rows and sometimes might need to limit the amount of rows returned.