My mode for doing this is :
I use the EnterpriseLibrary first off.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
namespace MyCompany.Applications.MyCustomApplication.Data
{
public abstract class DataLayerBase
{
private string _instanceName = string.Empty;
public DataLayerBase()
{
}
public DataLayerBase(string instanceName)
{
this._instanceName = instanceName;
}
protected Microsoft.Practices.EnterpriseLibrary.Data.Databas e
GetDatabase()
{
Database returnDb;
if (this._instanceName.Length 0)
{
returnDb =
DatabaseFactory.CreateDatabase(this._instanceName) ;
}
else
{
returnDb = DatabaseFactory.CreateDatabase();
}
return returnDb;
}
}
}
Then all my DataLayer objects (EmployeeData for example) inherit from that
class.
The .config file is just xml, so you can read it using Xpath statements.
which looks like
\\configuration\connectionStrings\add
XmlNodeList nl = root.SelectNodes ( \\configuration\connectionStrings\add) ;
something ~like that ( I have not tested this, just giving you an idea).
"Eigh" <Ei**@discussions.microsoft.comwrote in message
news:F3**********************************@microsof t.com...
I have a 3 tiered archetecture:
Presentation Layer running ASP.NET through VB.NET with a web.config & 2
connection strings defined in the web.config
Business Logic layer which is nothing more than a set of wrappers for the
DAL.
>
Data Access Layer, which is a set of data tables and data adapters created
through the XSD GUI.
I want the Connection Strings from my web.config to appear in the dropdown
list for the properties of the Data Adapters. How can I do this? Right
now, it only includes connection strings from MySettings, (New
Connection),
and (None).
Thanks,