N
Nicol
Hi,
My requirement is to use any Databse in my application as configurable.
Now I decided to use Enterprise library 4.0 to support all databases by
using common classe such as DBcommand, IDAtareader etc., have seen
enterprise library, by itself reads Database connections from confg file.. I
have requirement to add additional requiremnet to pass connection strings
from my code to Enterprise library to handle. i.e. If no connection string is
mentioned in the code, it should read from config file. How to specify
connection string via code.. The one i used is
Database db = DatabaseFactory.CreateDatabase("Test");
string sqlCommand = "Select * " +
"From audit";
DbCommand dbCommand = db.GetSqlStringCommand(sqlCommand);
using (IDataReader dataReader = db.ExecuteReader(dbCommand))
{
}
Where to specify connection string here?
Thanks in advance
Nithiya
My requirement is to use any Databse in my application as configurable.
Now I decided to use Enterprise library 4.0 to support all databases by
using common classe such as DBcommand, IDAtareader etc., have seen
enterprise library, by itself reads Database connections from confg file.. I
have requirement to add additional requiremnet to pass connection strings
from my code to Enterprise library to handle. i.e. If no connection string is
mentioned in the code, it should read from config file. How to specify
connection string via code.. The one i used is
Database db = DatabaseFactory.CreateDatabase("Test");
string sqlCommand = "Select * " +
"From audit";
DbCommand dbCommand = db.GetSqlStringCommand(sqlCommand);
using (IDataReader dataReader = db.ExecuteReader(dbCommand))
{
}
Where to specify connection string here?
Thanks in advance
Nithiya