Re: Component Creation

From: Matjaz Ladava (matjaz_at__nospam_ladava.com)
Date: 05/24/03


Date: Sat, 24 May 2003 16:33:56 +0200


Yes, your library will automaticaly use web.config of asp.net application.
you can try this. Simply create ASP.NET application, reference a library and
use ConfigurationSettings.AppSetting["youconnectstringname"] in your
library. It should contain value from your master wb.config file.

In asp.net web.config place yourconnectstringname unser <appSettings>
section

Regards

Matjaz Ladava

"Roshawn" <abreount316@msn.com> wrote in message
news:13c901c321e8$91ddd730$a601280a@phx.gbl...
> Hi ASP.NETters,
>
> I am designing a class library to use with my ASP.NET
> application. This library uses various tables in a
> database created with MSDE 2000. The connection string
> is contained within the library. However, I've seen
> examples in which the connection string is placed in the
> Web.config file.
>
> I'd like to create the class library so that it doesn't
> have to be recompiled should the connection string
> happens to change (for various reasons). How can I
> accomplish this? Can the library use the connection
> string stored in the Web.config file? If so, how?
>
> Thanks,
> Roshawn



Relevant Pages

  • Re: MSDE
    ... using in MSDE to the database, and then create a connection string ... >Access 2000 database using MSDE, and I have it working using Jet but would ... >As mentioned I would be very grateful for any advice. ...
    (microsoft.public.sqlserver.odbc)
  • Trying to access msde from ASP.NET
    ... I'm trying to run the ibuyspy ecommerce example using MSDE as a database. ... SQL Server does not exist or access denied. ... I've tried specifying a username and password in the connection string, both with the trusted connection string and without--to no avail. ...
    (microsoft.public.sqlserver.msde)
  • System.Data.SqlClient.SqlException
    ... I'm trying to run the ibuyspy ecommerce example using MSDE as a database. ... SQL Server does not exist or access denied. ... I've tried specifying a username and password in the connection string, both with the trusted connection string and without--to no avail. ...
    (microsoft.public.dotnet.general)
  • Re: Class question
    ... to the Config instance. ... You could, for instance, pass the reference in ... But I want the connection string to be defined only once and be used ... The place you want to store your connection string in is your ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ConfigurationSettings in Class Library
    ... > reference it in code: ... >> I'm writing a class library for my web app data access, ... >> hard code the database connection string in the class. ... >> pass the connection string in from the web app every time I access it. ...
    (microsoft.public.dotnet.framework.aspnet)

Loading