Firebird exception: Table unknown [duplicate]

╄→гoц情女王★ 提交于 2019-12-10 18:02:59

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/37369281/firebird-exception-table-unknown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!