469,356 Members | 2,646 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

The connection string in WebApp and class library

ad
I have a web application and a class library in a solution.

The class library is make of typed datasets, and include many Table in it.
The connection strings of the TableAdapters is come from the app.config of
that class library.

The Web application refer the class library, and the connection strings of
WebApp is come from the web.config of it.

It is ok in developing step, I can make both connection string identical in
both config files, but after I publish the web application or package the
web application for deployment, the app.config is vanish, so that if can
just change the connection if web.config, but can't change the connection is
app.config.

How can I do?

Mar 26 '06 #1
3 3714
ad,
your post seems to assume that the value for the class library is being read
from "it's own" app.config. Class Libraries (DLL) cannot use configuration
files natively. Store all your items in the web.config and they will be
available to the class library if it is referenced in the web application
project.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ad" wrote:
I have a web application and a class library in a solution.

The class library is make of typed datasets, and include many Table in it.
The connection strings of the TableAdapters is come from the app.config of
that class library.

The Web application refer the class library, and the connection strings of
WebApp is come from the web.config of it.

It is ok in developing step, I can make both connection string identical in
both config files, but after I publish the web application or package the
web application for deployment, the app.config is vanish, so that if can
just change the connection if web.config, but can't change the connection is
app.config.

How can I do?


Mar 26 '06 #2
Hi Peter, thanks for your post - I am having similar problems. Can I
ask you for a little more depth please. My web.config settings don't
seem to propagate down to the table adapters which sit in my class
library. The table adapters just use the same connection string as
specified in the class library app.config file.
can you please give me an example of how I am supposed to 'fully
qualify' the name of the connection string in the web.config file.

If you, or anybody else could please tell me how I can do? - then I
would be very grateful.
Thanks very much in advance.
Glyn.

Apr 11 '06 #3
As a follow up, I found out how i can do -

have a look here...
http://forums.asp.net/AddPost.aspx?PostID=1254468
Cheers,
Glyn.

Apr 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Aaron | last post: by
2 posts views Thread by Bryan | last post: by
2 posts views Thread by Phil Campaigne | last post: by
12 posts views Thread by Mats Lycken | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.