Hello,
I noticed that the property Connection.Database of my context is always empty.
The documentation says "Gets the name of the current database after a connection is opened, or the database name specified in the connection string before the connection is opened."
In fact, when my connection is closed, ctx.Connection.Database is empty.
After a ctx.Connection.Open(), this property is still empty.
I would like to get the current database type (Oracle, SQLServer) in order to execute a special store command. With this Database property always empty, I have no way to do that, except by inspecting the ServerVersion property that is equals to "Oracle Database 11g Release 11.2.0.1.0 - 64bit Production", but I would like to find a better solution.
Connection.Database property is empty
There is no way to override the default behaviour of the EntityConnection.Database property.
I recommend you the following way to check instead:
I recommend you the following way to check instead:
Code: Select all
if((ctx.Connection as EntityConnection).StoreConnection.GetType().Name == "OracleConnection")