I am trying to run a query on a dbase IV table from C#. I am not all that experienced with C# and I have come to my wits end because my select statement fails because the table I am trying to query contains a single quote.
I am using an ODBC connection to connect to the table and that part works fine. I run a query on the same table if I rename it and remove the quote.
I have tried escaping it with a backslash, using 2 single quotes, and parameterized the query only to find out this doesnt work with table names.
The command text is as so and this is the root of the problem...
cmd.CommandText = "SELECT * FROM E4X'MAIN";
Please Help I am completely stuck and have spent days looking for solutions only to be thwarted time after time...
FYI I have found a solution to my problem. If I structure my query like so shazam she works!!
cmd.CommandText = "SELECT * FROM \`E4X'MAIN.DBF\`;
Thanks for all your help hopefully this answer will help others stuck with horrible naming conventions
Reno