3

How can I query database schema in C#/ADO.NET/FirebirdClient? All classes in namespace Firebird.Data.Schema are internal.

For example: check if table has column with specified name query number of stored procedure parameters, its names and types

etc.

FirebirdClient - Compact Framework, NETProvider-2.5.2-CF.7z

2 Answers 2

3

You should query system tables (their names are prefixed with RDB$):

How to get a list of tables, views and columns in Firebird database?
RDB$ system objects

Sign up to request clarification or add additional context in comments.

2 Comments

I mean is there possible to use internal classes of FirebirdClient in my application. The code to query RDB$ tables is presented in this library and rewrite it twice is IMHO not very good idea
You may use any internal type via reflection, so, this is possible. Although, you should remember, that internal types usually are not documented, and their contract could be broken even between two releases. Also, you could ask FB client developer about making these types public. May be, there're some reasons, which prevents him to do this.
1

I' ve got it!

    FbConnection connection = (FbConnection)this.GetConnection();
    connection.GetSchema("procedureparameters", new string[] { null, null, procedureName });

Also it possible to retrieve all information about database objects with FbConnection ::GetSchema

See also FbSchemaFactory::PrepareCollection

3 Comments

Very cool! I'd be interested in learning what you're doing with it, too.
(hopefully, not snooping on your wife)
There is issue with Compact Framework: in FirebirdClient there is no FirebirdSql.Schema.FbMetaData.xml included (as embedded resource)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.