Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebird exception: Table unknown [duplicate]

I could establish the connection to a Firebird database with the following connection string:

ConnectionString = "User ID=SYSDBA;Password=masterkey;Database=localhost:C:\\MyDb\\mydb.FDB;DataSource=localhost;Charset=NONE;";

But when the C# code tries to execute the query the following error comes:

Dynamic SQL Error SQL Error Code = -204 Table unknown

The code that I've tried:

using FirebirdSql.Data.FirebirdClient;
...
FbConnection connection = new FbConnection(ConnectionString);
connection.Open();
FbCommand readCommand = new FbCommand("Select Name From Customer;", connection);
FbDataReader myreader = readCommand.ExecuteReader();

There definitely exists the Customer table (I've checked with IBExpert - in that I can read the data). I hardly found anything on Google.

Firebird 2.5 server is running on my Computer. What could be the problem?

like image 530
Mitulát báti Avatar asked Sep 18 '25 21:09

Mitulát báti


1 Answers

As you confirmed in the comments that the table name is actually "Customer", you will need to quote the object names in your query to make them case sensitive, so:

new FbCommand("Select \"Name\" From \"Customer\"", connection);

I have assumed that Name is also case sensitive, and therefor quoted it as well.

like image 125
Mark Rotteveel Avatar answered Sep 20 '25 10:09

Mark Rotteveel