GetSchema

Dec 13, 2008 at 5:18 PM

 

Hello:

I want to use GetSchema to query the current DB Schemma.

I use some like this:

// ---

 

 

string stringConnection = @"User=SYSDBA;Password=masterkey;Database=c:\db\mydb.fdb;DataSource=localhost; Port=3050;Dialect=3; Charset=NONE;Role=;Connection lifetime=15;Pooling=true; MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;"
FbConnection
fbc = new FbConnection(stringConnection);
fbc.Open();
DataTable tableColumns = fbc.GetSchema("Columns", new string[] { null, null, TableName });
DataTable

tableColumns = fbc.GetSchema("Columns", new string[] { null, null, TableName });

// --- end of code ---

How I can use it with DBContext  ..? (using the default Driver & String Connection defined in app.config)

thanks

 

Coordinator
Dec 14, 2008 at 1:01 AM
DbEntry.Context.GetTableNames();
DbEntry.Context.GetDbColumnInfoList(TableName);
Dec 14, 2008 at 11:21 AM
Thanks,

I use Firebird and I have a table with a column type NUMERIC(15,2)

When I run 

List

<DbColumnInfo> bb = DbEntry.Context.GetDbColumnInfoList("MyTable");

 


I get an error message:

Cannot convert Int32 type into Int16 type

regards

Coordinator
Dec 15, 2008 at 3:08 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.