Subject Re: [firebird-support] Field Name problem in Query
Author Helen Borrie
At 09:48 PM 30/11/2008, you wrote:
>Hi All,
>
>I am facing problem while fetching a field called 'DATE' from a table
>using C#.
>The query string is ..
>SqlDataSource1.SelectCommand = "Select First 10 NAME, DATE, ID from
>Table1";
>I am getting following error :
>//-----------//
>Dynamic SQL Error
>SQL error code = -104
>Token unknown - line 1, char 27
>,
>//-----------//

DATE is a reserved word. If you created this database under Firebird then the column name would have had to be "DATE" or some upper-lower case combination, otherwise it would have been disallowed. Quoted identifiers are case-sensitive.


>I have tried the following too ..
>SqlDataSource1.SelectCommand = "Select First 10 NAME, \"DATE\", ID
>from Table1";

For any column identifier to exist at all, the database dialect would have had to be Dialect 3. So check to make sure that you are passing the correct client SQL Dialect attribute in the DPB. Some older interfaces default it to 1. If you don't know how to do it with your interface, ask on the appropriate list (see http://firebirdsql.org/index.php?op=lists )

./heLen