Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.
Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.
Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.
We are new to Enterprise Library and .net also, we are getting the same error , May i know how it worked for one database, because we are not able to configure for single database also. Can you please tell how you configured for single database.
dev14
0 Points
5 Posts
Activation error occured while trying to get instance of type Database, key "DBName"
Jul 29, 2010 03:59 PM|LINK
Im using Enterprise library 5.0
<div id="DescriptionPanel">I have a scenario, where I have to access two different databases in my application.
Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.
Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.
<dataConfiguration defaultDatabase="MYCON1" />
<connectionStrings>
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"
providerName="System.Data.SqlClient
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient
</connectionStrings>
Database myDB=EnterpriseLibraryContainer.Cur
Database myDB=EnterpriseLibraryContainer.Cur
Activation error occured while trying to get instance of type Database, key "MYCON2"</div>
DAAB Enterprise Library 5.0
dev14
0 Points
5 Posts
Re: Activation error occured while trying to get instance of type Database, key "DBName"
Aug 02, 2010 05:52 PM|LINK
Does this make any sense? Im I doing it correctly?
Activation error occured while trying to get instance of type Database
sunny_lnct
Member
8 Points
15 Posts
Re: Activation error occured while trying to get instance of type Database, key "DBName"
Aug 27, 2010 09:36 AM|LINK
I don't see any issues with the syntax. I have used similer code & it works fine. Does your second database exists?
sabarishbabu
Member
71 Points
138 Posts
Re: Activation error occured while trying to get instance of type Database, key "DBName"
Nov 25, 2010 09:28 AM|LINK
Any update on this post?
Thanks
Sabarish
phanipriya10...
Member
2 Points
1 Post
Re: Activation error occured while trying to get instance of type Database, key "DBName"
Mar 01, 2011 03:33 AM|LINK
Hi
We are new to Enterprise Library and .net also, we are getting the same error , May i know how it worked for one database, because we are not able to configure for single database also. Can you please tell how you configured for single database.
Thank u in advance,
phani
Enterprise Library 5.0
nivas.vangal...
Member
2 Points
1 Post
Re: Activation error occured while trying to get instance of type Database, key "DBName"
Aug 06, 2012 06:53 PM|LINK
Hi have you find any solution for this? we are also gettng the same issue?
If you could provide any info is greately appreciated..
Thanks,
Srini