Create EnterpriseLibrary.Data.Database object from connection stri

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to create a
Microsoft.Practices.EnterpriseLibrary.Data.Database object without reading
from a configuration file?

I am writing a utility that manages databases in SQL Server. The utility
queries SQL Server for the database names. So I don't know the names of the
databases beforehand, but I will know the names and connection strings once
the server has been queried.

However, I have a class that I'd like to work with that requires a
Microsoft.Practices.EnterpriseLibrary.Data.Database object.

Is there any way to create a
Microsoft.Practices.EnterpriseLibrary.Data.Database when I already know the
connection string?

Thanks in advance
 
AFAIK you can not use a connection string. You must put the connection's
infomation in the data access blog configuration file.
You can use the Configuration Application Block in order to add database
configuration infomation to the data access blog configuration file.

--
Un saludo
Rodrigo Corral González [MVP]

FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org
 
Thank you for your quick response.

Are you able to point me to an example of how I'd do this? I haven't had any
luck in my searches.

Thanks again.
 
Back
Top