This is a migrated thread and some comments may be shown as answers.

Database Connections

5 Answers 173 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 07 Jan 2009, 05:14 PM
Just starting out looking into Open Access and have one question.  Can you over ride the database connection out side of the dll?

When making a code library you set up a db connection.  But then when you deploy that dll into another project, is there a way to change that connection in say the web.config file?

Will a connection string in the web.config file with the same name over ride the one made in app.config in the code library?  Or is this connection string always hard coded into the dll?


5 Answers, 1 is accepted

Sort by
0
Hessner
Top achievements
Rank 2
answered on 07 Jan 2009, 09:28 PM
Hi John,

Take a look at this new blog post.
0
John
Top achievements
Rank 1
answered on 07 Jan 2009, 09:37 PM
Ok, most excellent, this is exactly what I was wondering, this will make deploying without rebuilding the class library for multiple sites.  Thanks a bunch!
0
Majid
Top achievements
Rank 2
answered on 10 Feb 2009, 08:16 AM
Hi Hessner
I have read detail about setting the connection in BLOG but i am getting error "Connection 'DatabaseConnection' could not be found in config files.". Even i have provided the database id. This error occurs when i am deploying website in IIS. I have provided class mapping , database configuration and reference of DLL files also. Please can u help me. I am providing settings in web.config file.
Thanks. 
0
Thomas
Telerik team
answered on 10 Feb 2009, 09:24 AM
Hello Majid,

please verify that the connection name is indeed 'DatabaseConnection' in the web.config file and not 'DatabaseConnection1' (which is the default).

Greetings,
Thomas
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Majid
Top achievements
Rank 2
answered on 11 Feb 2009, 08:10 AM
Hello Thomas
It was same as in App.config. But i have solved it in other way. Thanks for reply.
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Hessner
Top achievements
Rank 2
John
Top achievements
Rank 1
Majid
Top achievements
Rank 2
Thomas
Telerik team
Share this question
or