I am using Visual C# to access a Pervasive v8.6 database via ODBC interface. I can't find the right syntax to Select a column whose name is two words (white space in middle). If the column name is only one word, I'm fine.
Table is: Appointment
One column name is: Appt Date
One column name is: Length
This C# code works when I put it in my data reader
string queryString = "Select Length FROM Appointment";
But if I do this,
string queryString = "Select Appt Date FROM Appointment";
I get a syntax errors. I've tried all kinds of combinations, just not the right one, including:
string queryString = "Select" + "Appt Date" + "FROM Appointment";
string queryString = "Select" ApptDate AS [Appt Date] FROM Appointment";
string queryString = "Select" [Appt Date] = ApptDate FROM Appointment";
I can't change the column names without crashing the program I am trying to access.
If I go into the pervasive control center and enter this command, it works ok:
SELECT "Appt Date" FROM "Appointment"
If I browse the database with visual studio, I can see the data as well.
thanks for your help!
david
Table is: Appointment
One column name is: Appt Date
One column name is: Length
This C# code works when I put it in my data reader
string queryString = "Select Length FROM Appointment";
But if I do this,
string queryString = "Select Appt Date FROM Appointment";
I get a syntax errors. I've tried all kinds of combinations, just not the right one, including:
string queryString = "Select" + "Appt Date" + "FROM Appointment";
string queryString = "Select" ApptDate AS [Appt Date] FROM Appointment";
string queryString = "Select" [Appt Date] = ApptDate FROM Appointment";
I can't change the column names without crashing the program I am trying to access.
If I go into the pervasive control center and enter this command, it works ok:
SELECT "Appt Date" FROM "Appointment"
If I browse the database with visual studio, I can see the data as well.
thanks for your help!
david