Hi all..
I have created a business logic component that is used from my ASP.NET
webform. It works, but connection string to the database is hard coded, as
in this method :
public DataSet GetCategories()
{
SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial
Catalog=XXXX;User ID=X;Password=Y");
SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM FROM
CATEGORIA ORDER BY CAT_NOM", conn);
DataSet ds = new DataSet();
adapter.Fill(ds);
return ds;
}
I need to know what is the best way to pass the connection string that is
present in the web.config file. I tried using a constructor in that business
class but with no success. Also I have read that ObjectDataSource uses
stateless components so I think the usage of properties isn't allowed here.
The question is, the only solution I could implement is passing the
connection string as a parameter to GetCategories? is there another one?
Since this method resides in a DLL, I cannot use ConnectionManager class to
access web.config file.
Thanks a lot
Jaime 19 2475
if you have it in Web.Config like:-
<add key="ConnectionString" value="server=(local);database=YourDB;integrated
security=true;" />
Then in you app do:-
myconnection = New
SqlConnection(ConfigurationSettings.AppSettings("C onnectionString"))
Is that what you are looking for.
Patrick
"Jaime Stuardo" <js******@manquehue.net> wrote in message
news:ef**************@TK2MSFTNGP14.phx.gbl... Hi all..
I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method :
public DataSet GetCategories() { SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial Catalog=XXXX;User ID=X;Password=Y"); SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM
FROM CATEGORIA ORDER BY CAT_NOM", conn); DataSet ds = new DataSet(); adapter.Fill(ds); return ds; }
I need to know what is the best way to pass the connection string that is present in the web.config file. I tried using a constructor in that
business class but with no success. Also I have read that ObjectDataSource uses stateless components so I think the usage of properties isn't allowed
here. The question is, the only solution I could implement is passing the connection string as a parameter to GetCategories? is there another one? Since this method resides in a DLL, I cannot use ConnectionManager class
to access web.config file.
Thanks a lot Jaime
the best solution is to write you own application setting class (use
interfaces). this allows multiple implementation of loading settings, but
one for reading.
hint: use the factory model to allow a static create method.
-- bruce (sqlwork.com)
"Jaime Stuardo" <js******@manquehue.net> wrote in message
news:ef**************@TK2MSFTNGP14.phx.gbl... Hi all..
I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method :
public DataSet GetCategories() { SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial Catalog=XXXX;User ID=X;Password=Y"); SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM FROM CATEGORIA ORDER BY CAT_NOM", conn); DataSet ds = new DataSet(); adapter.Fill(ds); return ds; }
I need to know what is the best way to pass the connection string that is present in the web.config file. I tried using a constructor in that business class but with no success. Also I have read that ObjectDataSource uses stateless components so I think the usage of properties isn't allowed here.
The question is, the only solution I could implement is passing the connection string as a parameter to GetCategories? is there another one? Since this method resides in a DLL, I cannot use ConnectionManager class to access web.config file.
Thanks a lot Jaime
Hi Patrick..
I cannot do that since this method is in a DLL that is referenced by the
ASP.NET project. When I use AppSettings from the component, I receive a
null. However I think I could use what you suggested if I have public
DataSet GetCategories(String connectionStr).
By the way, I use ASP.NET 2.0 and in this version
ConfigurationSettings.AppSettings is reported as obsolete. I should use
ConfigurationManager.AppSettings instead.
Jaime
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl... if you have it in Web.Config like:- <add key="ConnectionString" value="server=(local);database=YourDB;integrated security=true;" /> Then in you app do:- myconnection = New SqlConnection(ConfigurationSettings.AppSettings("C onnectionString")) Is that what you are looking for. Patrick
"Jaime Stuardo" <js******@manquehue.net> wrote in message news:ef**************@TK2MSFTNGP14.phx.gbl... Hi all..
I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method :
public DataSet GetCategories() { SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial Catalog=XXXX;User ID=X;Password=Y"); SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM FROM CATEGORIA ORDER BY CAT_NOM", conn); DataSet ds = new DataSet(); adapter.Fill(ds); return ds; }
I need to know what is the best way to pass the connection string that is present in the web.config file. I tried using a constructor in that business class but with no success. Also I have read that ObjectDataSource uses stateless components so I think the usage of properties isn't allowed here. The question is, the only solution I could implement is passing the connection string as a parameter to GetCategories? is there another one? Since this method resides in a DLL, I cannot use ConnectionManager class
to access web.config file.
Thanks a lot Jaime
FYI, to actually use System.Configuration.ConfigurationManager.AppSetti ngs
in 2.0 you must add a reference to System.configuration.dll. (I wasted a
lot of time trying to figure that out).
This is not necessary to do to use
System.Configuration.ConfigurationSettings.AppSett ings and I not sure why.
Can anyone explain?
Greg
"Jaime Stuardo" <js******@manquehue.net> wrote in message
news:uM*************@TK2MSFTNGP14.phx.gbl... Hi Patrick..
I cannot do that since this method is in a DLL that is referenced by the ASP.NET project. When I use AppSettings from the component, I receive a null. However I think I could use what you suggested if I have public DataSet GetCategories(String connectionStr).
By the way, I use ASP.NET 2.0 and in this version ConfigurationSettings.AppSettings is reported as obsolete. I should use ConfigurationManager.AppSettings instead.
Jaime
"Patrick.O.Ige" <na********@hotmail.com> wrote in message news:em**************@TK2MSFTNGP12.phx.gbl... if you have it in Web.Config like:- <add key="ConnectionString" value="server=(local);database=YourDB;integrated security=true;" /> Then in you app do:- myconnection = New SqlConnection(ConfigurationSettings.AppSettings("C onnectionString")) Is that what you are looking for. Patrick
"Jaime Stuardo" <js******@manquehue.net> wrote in message news:ef**************@TK2MSFTNGP14.phx.gbl... Hi all..
I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method :
public DataSet GetCategories() { SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial Catalog=XXXX;User ID=X;Password=Y"); SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM FROM CATEGORIA ORDER BY CAT_NOM", conn); DataSet ds = new DataSet(); adapter.Fill(ds); return ds; }
I need to know what is the best way to pass the connection string that is present in the web.config file. I tried using a constructor in that business class but with no success. Also I have read that ObjectDataSource uses stateless components so I think the usage of properties isn't allowed here. The question is, the only solution I could implement is passing the connection string as a parameter to GetCategories? is there another one? Since this method resides in a DLL, I cannot use ConnectionManager class
to access web.config file.
Thanks a lot Jaime
Hi, Greg.
re: Can anyone explain?
System.Configuration.ConfigurationSettings.AppSett ings
is a class in the System.Configuration namespace in system.dll.
System.Configuration.ConfigurationManager.AppSetti ngs isn't.
See : http://www.asp.net/QUICKSTART/util/c....Configuration
Configuration.ConfigurationManager is a class which resides in
System.Configuration (in system.configuration.dll), not in system.dll
which is where Configuration.ConfigurationSettings.AppSettings resides.
It's a bit confusing because the System.Configuration first names seem the same,
but -just like you do with people- you need a first name *and* a last name
to identify individuals.
The System.Configuration class in System.dll is really System.System.Configuration
( notice the *two* "system" in the name ) but we don't have to identify the base
namespace because it's automatically imported in all aspx pages.
If you want to use the ConfigurationManager.AppSettings class which is
a part of system.configuration.dll without importing the namespace,
you'll need to use its full name :
System.Configuration.System.Configuration.Configur ationManager.AppSettings
That because the System.Configuration.System.Configuration namespace
is *not* imported automatically into every aspx page.
I hope this is clearer to you now.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:ut*************@TK2MSFTNGP15.phx.gbl... FYI, to actually use System.Configuration.ConfigurationManager.AppSetti ngs in 2.0 you must add a reference to System.configuration.dll. (I wasted a lot of time trying to figure that out).
This is not necessary to do to use System.Configuration.ConfigurationSettings.AppSett ings and I not sure why. Can anyone explain?
Greg
"Jaime Stuardo" <js******@manquehue.net> wrote in message news:uM*************@TK2MSFTNGP14.phx.gbl... Hi Patrick..
I cannot do that since this method is in a DLL that is referenced by the ASP.NET project. When I use AppSettings from the component, I receive a null. However I think I could use what you suggested if I have public DataSet GetCategories(String connectionStr).
By the way, I use ASP.NET 2.0 and in this version ConfigurationSettings.AppSettings is reported as obsolete. I should use ConfigurationManager.AppSettings instead.
Jaime
"Patrick.O.Ige" <na********@hotmail.com> wrote in message news:em**************@TK2MSFTNGP12.phx.gbl... if you have it in Web.Config like:- <add key="ConnectionString" value="server=(local);database=YourDB;integrated security=true;" /> Then in you app do:- myconnection = New SqlConnection(ConfigurationSettings.AppSettings("C onnectionString")) Is that what you are looking for. Patrick
"Jaime Stuardo" <js******@manquehue.net> wrote in message news:ef**************@TK2MSFTNGP14.phx.gbl... Hi all..
I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method :
public DataSet GetCategories() { SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial Catalog=XXXX;User ID=X;Password=Y"); SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM FROM CATEGORIA ORDER BY CAT_NOM", conn); DataSet ds = new DataSet(); adapter.Fill(ds); return ds; }
I need to know what is the best way to pass the connection string that is present in the web.config file. I tried using a constructor in that business class but with no success. Also I have read that ObjectDataSource uses stateless components so I think the usage of properties isn't allowed here.
The question is, the only solution I could implement is passing the connection string as a parameter to GetCategories? is there another one? Since this method resides in a DLL, I cannot use ConnectionManager class to access web.config file.
Thanks a lot Jaime
'System' does not exist in the namespace 'System.Configuration'
I added C:\Windows\Microsoft.NET\Framework\v2.0.50727\Syst em.configuration.dll
I also added using System.Configuration;
Here is the line of code it errors on.
string sConnString =
System.Configuration.System.Configuration.Configur ationManager.AppSettings["dsn"];
For now, I'm staying with ConfigurationSettings and live with the warnings.
string sConnString =
System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
"Juan T. Llibre" wrote: Hi, Greg.
re: Can anyone explain?
System.Configuration.ConfigurationSettings.AppSett ings is a class in the System.Configuration namespace in system.dll.
System.Configuration.ConfigurationManager.AppSetti ngs isn't.
See :
http://www.asp.net/QUICKSTART/util/c....Configuration
Configuration.ConfigurationManager is a class which resides in System.Configuration (in system.configuration.dll), not in system.dll which is where Configuration.ConfigurationSettings.AppSettings resides.
It's a bit confusing because the System.Configuration first names seem the same, but -just like you do with people- you need a first name *and* a last name to identify individuals.
The System.Configuration class in System.dll is really System.System.Configuration ( notice the *two* "system" in the name ) but we don't have to identify the base namespace because it's automatically imported in all aspx pages.
If you want to use the ConfigurationManager.AppSettings class which is a part of system.configuration.dll without importing the namespace, you'll need to use its full name :
System.Configuration.System.Configuration.Configur ationManager.AppSettings
That because the System.Configuration.System.Configuration namespace is *not* imported automatically into every aspx page.
I hope this is clearer to you now. Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Greg Burns" <bl*******@newsgroups.nospam> wrote in message news:ut*************@TK2MSFTNGP15.phx.gbl... FYI, to actually use System.Configuration.ConfigurationManager.AppSetti ngs in 2.0 you must add a reference to System.configuration.dll. (I wasted a lot of time trying to figure that out).
This is not necessary to do to use System.Configuration.ConfigurationSettings.AppSett ings and I not sure why. Can anyone explain?
Greg
"Jaime Stuardo" <js******@manquehue.net> wrote in message news:uM*************@TK2MSFTNGP14.phx.gbl... Hi Patrick..
I cannot do that since this method is in a DLL that is referenced by the ASP.NET project. When I use AppSettings from the component, I receive a null. However I think I could use what you suggested if I have public DataSet GetCategories(String connectionStr).
By the way, I use ASP.NET 2.0 and in this version ConfigurationSettings.AppSettings is reported as obsolete. I should use ConfigurationManager.AppSettings instead.
Jaime
"Patrick.O.Ige" <na********@hotmail.com> wrote in message news:em**************@TK2MSFTNGP12.phx.gbl... if you have it in Web.Config like:- <add key="ConnectionString" value="server=(local);database=YourDB;integrated security=true;" /> Then in you app do:- myconnection = New SqlConnection(ConfigurationSettings.AppSettings("C onnectionString")) Is that what you are looking for. Patrick
"Jaime Stuardo" <js******@manquehue.net> wrote in message news:ef**************@TK2MSFTNGP14.phx.gbl... > Hi all.. > > I have created a business logic component that is used from my ASP.NET > webform. It works, but connection string to the database is hard coded, as > in this method : > > public DataSet GetCategories() > { > SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial > Catalog=XXXX;User ID=X;Password=Y"); > SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM FROM > CATEGORIA ORDER BY CAT_NOM", conn); > DataSet ds = new DataSet(); > adapter.Fill(ds); > return ds; > } > > I need to know what is the best way to pass the connection string that is > present in the web.config file. I tried using a constructor in that business > class but with no success. Also I have read that ObjectDataSource uses > stateless components so I think the usage of properties isn't allowed here. > > The question is, the only solution I could implement is passing the > connection string as a parameter to GetCategories? is there another one? > Since this method resides in a DLL, I cannot use ConnectionManager class to > access web.config file. > > Thanks a lot > Jaime > >
Just import system.configuration and use :
string sConnString = System.Configuration.ConfigurationManager.AppSetti ngs["dsn"];
The thing is that the ConfigurationManager class isn't meant to be used
just to read a key and insert the key's string value into a connection.
It's meant to be used to *modify* configuration files.
If you just want to read a value in web.config, use :
System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Mike L" <Ca***@nospam.nospam> wrote in message
news:F1**********************************@microsof t.com... 'System' does not exist in the namespace 'System.Configuration'
I added C:\Windows\Microsoft.NET\Framework\v2.0.50727\Syst em.configuration.dll I also added using System.Configuration;
Here is the line of code it errors on. string sConnString = System.Configuration.System.Configuration.Configur ationManager.AppSettings["dsn"];
For now, I'm staying with ConfigurationSettings and live with the warnings. string sConnString = System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
"Juan T. Llibre" wrote:
Hi, Greg.
re: > Can anyone explain?
System.Configuration.ConfigurationSettings.AppSett ings is a class in the System.Configuration namespace in system.dll.
System.Configuration.ConfigurationManager.AppSetti ngs isn't.
See :
http://www.asp.net/QUICKSTART/util/c....Configuration
Configuration.ConfigurationManager is a class which resides in System.Configuration (in system.configuration.dll), not in system.dll which is where Configuration.ConfigurationSettings.AppSettings resides.
It's a bit confusing because the System.Configuration first names seem the same, but -just like you do with people- you need a first name *and* a last name to identify individuals.
The System.Configuration class in System.dll is really System.System.Configuration ( notice the *two* "system" in the name ) but we don't have to identify the base namespace because it's automatically imported in all aspx pages.
If you want to use the ConfigurationManager.AppSettings class which is a part of system.configuration.dll without importing the namespace, you'll need to use its full name :
System.Configuration.System.Configuration.Configur ationManager.AppSettings
That because the System.Configuration.System.Configuration namespace is *not* imported automatically into every aspx page.
I hope this is clearer to you now. Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Greg Burns" <bl*******@newsgroups.nospam> wrote in message news:ut*************@TK2MSFTNGP15.phx.gbl... > FYI, to actually use System.Configuration.ConfigurationManager.AppSetti ngs in 2.0 you > must add a reference to System.configuration.dll. (I wasted a lot of time trying to > figure that out). > > This is not necessary to do to use > System.Configuration.ConfigurationSettings.AppSett ings and I not sure why. Can anyone > explain? > > Greg > > "Jaime Stuardo" <js******@manquehue.net> wrote in message > news:uM*************@TK2MSFTNGP14.phx.gbl... >> Hi Patrick.. >> >> I cannot do that since this method is in a DLL that is referenced by the ASP.NET >> project. When I use AppSettings from the component, I receive a null. However I >> think I >> could use what you suggested if I have public DataSet GetCategories(String >> connectionStr). >> >> By the way, I use ASP.NET 2.0 and in this version ConfigurationSettings.AppSettings >> is >> reported as obsolete. I should use ConfigurationManager.AppSettings instead. >> >> Jaime >> >> "Patrick.O.Ige" <na********@hotmail.com> wrote in message >> news:em**************@TK2MSFTNGP12.phx.gbl... >>> if you have it in Web.Config like:- >>> <add key="ConnectionString" value="server=(local);database=YourDB;integrated >>> security=true;" /> >>> Then in you app do:- >>> myconnection = New >>> SqlConnection(ConfigurationSettings.AppSettings("C onnectionString")) >>> Is that what you are looking for. >>> Patrick >>> >>> >>> "Jaime Stuardo" <js******@manquehue.net> wrote in message >>> news:ef**************@TK2MSFTNGP14.phx.gbl... >>>> Hi all.. >>>> >>>> I have created a business logic component that is used from my ASP.NET >>>> webform. It works, but connection string to the database is hard coded, as >>>> in this method : >>>> >>>> public DataSet GetCategories() >>>> { >>>> SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial >>>> Catalog=XXXX;User ID=X;Password=Y"); >>>> SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM >>> FROM >>>> CATEGORIA ORDER BY CAT_NOM", conn); >>>> DataSet ds = new DataSet(); >>>> adapter.Fill(ds); >>>> return ds; >>>> } >>>> >>>> I need to know what is the best way to pass the connection string that is >>>> present in the web.config file. I tried using a constructor in that >>> business >>>> class but with no success. Also I have read that ObjectDataSource uses >>>> stateless components so I think the usage of properties isn't allowed >>> here. >>>> >>>> The question is, the only solution I could implement is passing the >>>> connection string as a parameter to GetCategories? is there another one? >>>> Since this method resides in a DLL, I cannot use ConnectionManager class >>> to >>>> access web.config file. >>>> >>>> Thanks a lot >>>> Jaime >>>> >>>> >>> >>> >> >> > >
> If you want to use the ConfigurationManager.AppSettings class which is a part of system.configuration.dll without importing the namespace, you'll need to use its full name :
System.Configuration.System.Configuration.Configur ationManager.AppSettings
That because the System.Configuration.System.Configuration namespace is *not* imported automatically into every aspx page.
I hope this is clearer to you now.
Not really. I guess I'm a little dense. :^)
This, of course, compiles just fine:
Dim sConnString As String =
System.Configuration.ConfigurationManager.AppSetti ngs("dsn")
and this (because System is imported by default in VB)
Dim sConnString As String =
Configuration.ConfigurationManager.AppSettings("ds n")
and if I import System.Configuation I would just use:
Imports System.Configuration
Dim sConnString As String = ConfigurationManager.AppSettings("dsn")
but now this won't compile: ?
Imports System.Configuration
Dim sConnString As String =
Configuration.ConfigurationManager.AppSettings("ds n")
Error: 'System' is not a member of 'System.Configuration.Configuration'
And I can't get this line to compile at all...?
Dim sConnString As String =
System.Configuration.System.Configuration.Configur ationManager.AppSettings("dsn")
Error: 'System' is not a member of 'Configuration'
I don't think I will ever completely understand this. Don't bother trying to
explain it to me again, I'm hopeless. :^)
The thing is that the ConfigurationManager class isn't meant to be used just to read a key and insert the key's string value into a connection.
It's meant to be used to *modify* configuration files.
If you just want to read a value in web.config, use : System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
Interesting, never heard that metioned before. I thought we were expected
to stop using System.Configuration.ConfigurationSettings.AppSett ings?
Greg
I'm reading a value from App.config
My project is a C# 2005 win form application.
Should I ignore the warring messages for "string sConnString =
System.Configuration.ConfigurationSettings.AppSett ings["dsn"];" ?
"Juan T. Llibre" wrote: Just import system.configuration and use : string sConnString = System.Configuration.ConfigurationManager.AppSetti ngs["dsn"];
The thing is that the ConfigurationManager class isn't meant to be used just to read a key and insert the key's string value into a connection.
It's meant to be used to *modify* configuration files.
If you just want to read a value in web.config, use : System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Mike L" <Ca***@nospam.nospam> wrote in message news:F1**********************************@microsof t.com... 'System' does not exist in the namespace 'System.Configuration'
I added C:\Windows\Microsoft.NET\Framework\v2.0.50727\Syst em.configuration.dll I also added using System.Configuration;
Here is the line of code it errors on. string sConnString = System.Configuration.System.Configuration.Configur ationManager.AppSettings["dsn"];
For now, I'm staying with ConfigurationSettings and live with the warnings. string sConnString = System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
"Juan T. Llibre" wrote:
Hi, Greg.
re: > Can anyone explain?
System.Configuration.ConfigurationSettings.AppSett ings is a class in the System.Configuration namespace in system.dll.
System.Configuration.ConfigurationManager.AppSetti ngs isn't.
See :
http://www.asp.net/QUICKSTART/util/c....Configuration
Configuration.ConfigurationManager is a class which resides in System.Configuration (in system.configuration.dll), not in system.dll which is where Configuration.ConfigurationSettings.AppSettings resides.
It's a bit confusing because the System.Configuration first names seem the same, but -just like you do with people- you need a first name *and* a last name to identify individuals.
The System.Configuration class in System.dll is really System.System.Configuration ( notice the *two* "system" in the name ) but we don't have to identify the base namespace because it's automatically imported in all aspx pages.
If you want to use the ConfigurationManager.AppSettings class which is a part of system.configuration.dll without importing the namespace, you'll need to use its full name :
System.Configuration.System.Configuration.Configur ationManager.AppSettings
That because the System.Configuration.System.Configuration namespace is *not* imported automatically into every aspx page.
I hope this is clearer to you now. Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Greg Burns" <bl*******@newsgroups.nospam> wrote in message news:ut*************@TK2MSFTNGP15.phx.gbl... > FYI, to actually use System.Configuration.ConfigurationManager.AppSetti ngs in 2.0 you > must add a reference to System.configuration.dll. (I wasted a lot of time trying to > figure that out). > > This is not necessary to do to use > System.Configuration.ConfigurationSettings.AppSett ings and I not sure why. Can anyone > explain? > > Greg > > "Jaime Stuardo" <js******@manquehue.net> wrote in message > news:uM*************@TK2MSFTNGP14.phx.gbl... >> Hi Patrick.. >> >> I cannot do that since this method is in a DLL that is referenced by the ASP.NET >> project. When I use AppSettings from the component, I receive a null. However I >> think I >> could use what you suggested if I have public DataSet GetCategories(String >> connectionStr). >> >> By the way, I use ASP.NET 2.0 and in this version ConfigurationSettings.AppSettings >> is >> reported as obsolete. I should use ConfigurationManager.AppSettings instead. >> >> Jaime >> >> "Patrick.O.Ige" <na********@hotmail.com> wrote in message >> news:em**************@TK2MSFTNGP12.phx.gbl... >>> if you have it in Web.Config like:- >>> <add key="ConnectionString" value="server=(local);database=YourDB;integrated >>> security=true;" /> >>> Then in you app do:- >>> myconnection = New >>> SqlConnection(ConfigurationSettings.AppSettings("C onnectionString")) >>> Is that what you are looking for. >>> Patrick >>> >>> >>> "Jaime Stuardo" <js******@manquehue.net> wrote in message >>> news:ef**************@TK2MSFTNGP14.phx.gbl... >>>> Hi all.. >>>> >>>> I have created a business logic component that is used from my ASP.NET >>>> webform. It works, but connection string to the database is hard coded, as >>>> in this method : >>>> >>>> public DataSet GetCategories() >>>> { >>>> SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial >>>> Catalog=XXXX;User ID=X;Password=Y"); >>>> SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM >>> FROM >>>> CATEGORIA ORDER BY CAT_NOM", conn); >>>> DataSet ds = new DataSet(); >>>> adapter.Fill(ds); >>>> return ds; >>>> } >>>> >>>> I need to know what is the best way to pass the connection string that is >>>> present in the web.config file. I tried using a constructor in that >>> business >>>> class but with no success. Also I have read that ObjectDataSource uses >>>> stateless components so I think the usage of properties isn't allowed >>> here. >>>> >>>> The question is, the only solution I could implement is passing the >>>> connection string as a parameter to GetCategories? is there another one? >>>> Since this method resides in a DLL, I cannot use ConnectionManager class >>> to >>>> access web.config file. >>>> >>>> Thanks a lot >>>> Jaime >>>> >>>> >>> >>> >> >> > >
Well, other than an obvious typo, it's a sound explanation.
If you need to verify, download Lutz Roeder's Reflector: http://www.aisto.com/roeder/dotnet/
and take a look at both assemblies : System.dll and System.configuration.dll
You'll understand what I meant immediately.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:eW**************@TK2MSFTNGP09.phx.gbl... If you want to use the ConfigurationManager.AppSettings class which is a part of system.configuration.dll without importing the namespace, you'll need to use its full name :
System.Configuration.System.Configuration.Configur ationManager.AppSettings
That because the System.Configuration.System.Configuration namespace is *not* imported automatically into every aspx page.
I hope this is clearer to you now.
Not really. I guess I'm a little dense. :^)
This, of course, compiles just fine: Dim sConnString As String = System.Configuration.ConfigurationManager.AppSetti ngs("dsn")
and this (because System is imported by default in VB) Dim sConnString As String = Configuration.ConfigurationManager.AppSettings("ds n")
and if I import System.Configuation I would just use: Imports System.Configuration Dim sConnString As String = ConfigurationManager.AppSettings("dsn")
but now this won't compile: ? Imports System.Configuration Dim sConnString As String = Configuration.ConfigurationManager.AppSettings("ds n") Error: 'System' is not a member of 'System.Configuration.Configuration'
And I can't get this line to compile at all...? Dim sConnString As String = System.Configuration.System.Configuration.Configur ationManager.AppSettings("dsn")
Error: 'System' is not a member of 'Configuration'
I don't think I will ever completely understand this. Don't bother trying to explain it to me again, I'm hopeless. :^)
The thing is that the ConfigurationManager class isn't meant to be used just to read a key and insert the key's string value into a connection.
It's meant to be used to *modify* configuration files.
If you just want to read a value in web.config, use : System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
Interesting, never heard that metioned before. I thought we were expected to stop using System.Configuration.ConfigurationSettings.AppSett ings?
Greg
re: I'm reading a value from App.config
Isn't System.Configuration.ConfigurationSettings.AppSett ings
hard-wired to read from web.config if you're writing a web application?
Are you talking about a Windows Forms app.config ?
Windows applications in the .NET Framework use
the name app.config by default for their configuration file.
Web applications use web.config by default for the configuration file.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Mike L" <Ca***@nospam.nospam> wrote in message
news:D6**********************************@microsof t.com... I'm reading a value from App.config My project is a C# 2005 win form application.
Should I ignore the warring messages for "string sConnString = System.Configuration.ConfigurationSettings.AppSett ings["dsn"];" ?
"Juan T. Llibre" wrote:
Just import system.configuration and use : string sConnString = System.Configuration.ConfigurationManager.AppSetti ngs["dsn"];
The thing is that the ConfigurationManager class isn't meant to be used just to read a key and insert the key's string value into a connection.
It's meant to be used to *modify* configuration files.
If you just want to read a value in web.config, use : System.Configuration.ConfigurationSettings.AppSett ings["dsn"];
Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Mike L" <Ca***@nospam.nospam> wrote in message news:F1**********************************@microsof t.com... > 'System' does not exist in the namespace 'System.Configuration' > > I added C:\Windows\Microsoft.NET\Framework\v2.0.50727\Syst em.configuration.dll > I also added using System.Configuration; > > Here is the line of code it errors on. > string sConnString = > System.Configuration.System.Configuration.Configur ationManager.AppSettings["dsn"]; > > > For now, I'm staying with ConfigurationSettings and live with the warnings. > string sConnString = > System.Configuration.ConfigurationSettings.AppSett ings["dsn"]; > > > "Juan T. Llibre" wrote: > >> Hi, Greg. >> >> re: >> > Can anyone explain? >> >> System.Configuration.ConfigurationSettings.AppSett ings >> is a class in the System.Configuration namespace in system.dll. >> >> System.Configuration.ConfigurationManager.AppSetti ngs isn't. >> >> See : >> >> http://www.asp.net/QUICKSTART/util/c....Configuration >> >> Configuration.ConfigurationManager is a class which resides in >> System.Configuration (in system.configuration.dll), not in system.dll >> which is where Configuration.ConfigurationSettings.AppSettings resides. >> >> It's a bit confusing because the System.Configuration first names seem the same, >> but -just like you do with people- you need a first name *and* a last name >> to identify individuals. >> >> The System.Configuration class in System.dll is really System.System.Configuration >> ( notice the *two* "system" in the name ) but we don't have to identify the base >> namespace because it's automatically imported in all aspx pages. >> >> If you want to use the ConfigurationManager.AppSettings class which is >> a part of system.configuration.dll without importing the namespace, >> you'll need to use its full name : >> >> System.Configuration.System.Configuration.Configur ationManager.AppSettings >> >> That because the System.Configuration.System.Configuration namespace >> is *not* imported automatically into every aspx page. >> >> I hope this is clearer to you now. >> >> >> >> Juan T. Llibre, ASP.NET MVP >> ASP.NET FAQ : http://asp.net.do/faq/ >> ASPNETFAQ.COM : http://www.aspnetfaq.com/ >> Foros de ASP.NET en Español : http://asp.net.do/foros/ >> ====================================== >> "Greg Burns" <bl*******@newsgroups.nospam> wrote in message >> news:ut*************@TK2MSFTNGP15.phx.gbl... >> > FYI, to actually use System.Configuration.ConfigurationManager.AppSetti ngs in 2.0 >> > you >> > must add a reference to System.configuration.dll. (I wasted a lot of time trying >> > to >> > figure that out). >> > >> > This is not necessary to do to use >> > System.Configuration.ConfigurationSettings.AppSett ings and I not sure why. Can >> > anyone >> > explain? >> > >> > Greg >> > >> > "Jaime Stuardo" <js******@manquehue.net> wrote in message >> > news:uM*************@TK2MSFTNGP14.phx.gbl... >> >> Hi Patrick.. >> >> >> >> I cannot do that since this method is in a DLL that is referenced by the ASP.NET >> >> project. When I use AppSettings from the component, I receive a null. However I >> >> think I >> >> could use what you suggested if I have public DataSet GetCategories(String >> >> connectionStr). >> >> >> >> By the way, I use ASP.NET 2.0 and in this version >> >> ConfigurationSettings.AppSettings >> >> is >> >> reported as obsolete. I should use ConfigurationManager.AppSettings instead. >> >> >> >> Jaime >> >> >> >> "Patrick.O.Ige" <na********@hotmail.com> wrote in message >> >> news:em**************@TK2MSFTNGP12.phx.gbl... >> >>> if you have it in Web.Config like:- >> >>> <add key="ConnectionString" value="server=(local);database=YourDB;integrated >> >>> security=true;" /> >> >>> Then in you app do:- >> >>> myconnection = New >> >>> SqlConnection(ConfigurationSettings.AppSettings("C onnectionString")) >> >>> Is that what you are looking for. >> >>> Patrick >> >>> >> >>> >> >>> "Jaime Stuardo" <js******@manquehue.net> wrote in message >> >>> news:ef**************@TK2MSFTNGP14.phx.gbl... >> >>>> Hi all.. >> >>>> >> >>>> I have created a business logic component that is used from my ASP.NET >> >>>> webform. It works, but connection string to the database is hard coded, as >> >>>> in this method : >> >>>> >> >>>> public DataSet GetCategories() >> >>>> { >> >>>> SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial >> >>>> Catalog=XXXX;User ID=X;Password=Y"); >> >>>> SqlDataAdapter adapter = new SqlDataAdapter("SELECT CAT_ID, CAT_NOM >> >>> FROM >> >>>> CATEGORIA ORDER BY CAT_NOM", conn); >> >>>> DataSet ds = new DataSet(); >> >>>> adapter.Fill(ds); >> >>>> return ds; >> >>>> } >> >>>> >> >>>> I need to know what is the best way to pass the connection string that is >> >>>> present in the web.config file. I tried using a constructor in that >> >>> business >> >>>> class but with no success. Also I have read that ObjectDataSource uses >> >>>> stateless components so I think the usage of properties isn't allowed >> >>> here. >> >>>> >> >>>> The question is, the only solution I could implement is passing the >> >>>> connection string as a parameter to GetCategories? is there another one? >> >>>> Since this method resides in a DLL, I cannot use ConnectionManager class >> >>> to >> >>>> access web.config file. >> >>>> >> >>>> Thanks a lot >> >>>> Jaime >> >>>> >> >>>> >> >>> >> >>> >> >> >> >> >> > >> > >> >> >>
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl... Isn't System.Configuration.ConfigurationSettings.AppSett ings hard-wired to read from web.config if you're writing a web application?
Are you talking about a Windows Forms app.config ?
Windows applications in the .NET Framework use the name app.config by default for their configuration file.
Web applications use web.config by default for the configuration file.
ACK.
But what about his question?
Should I ignore the warring messages for "string sConnString = System.Configuration.ConfigurationSettings.AppSet tings["dsn"];" ?
Sounds like you are saying you should ingore the warnings and continue to
use ConfigurationSettings.AppSettings for reading from web.config and
app.config files. This is the first time I've heard somebody suggest that.
I was under the impressions that ConfigurationSettings.AppSettings was
obsolete and should be avoided in favor of the new
ConfigurationManager.AppSettings.
Greg
re: ConfigurationSettings.AppSettings was obsolete and should be avoided in favor of the new ConfigurationManager.AppSettings
It is *deprecated*, not obsolete.
You can *still* read web.config values with ConfigurationSettings.AppSettings.
At some point in the future, though, it will stop working. (.Net Framework 3.0 ?)
re: Sounds like you are saying you should ingore the warnings and continue to use ConfigurationSettings.AppSettings for reading from web.config and app.config files.
Like I said, app.config is for Windows Forms,
and web.config is for web applications.
He said he was using app.config, but this is a web applications newsgroup.
If he is getting warnings when he uses app.config in a web application,
then he should, simply, only use app.config for Windows applications,
and use web.config for web applications.
Otherwise, if he is using app.config in a Windows Application,
he should post to the right newsgroup for Windows apps, which is :
microsoft.public.dotnet.framework.windowsforms or any of its subgroups.
Is that clearer now ?
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:eD**************@TK2MSFTNGP09.phx.gbl... "Juan T. Llibre" <no***********@nowhere.com> wrote in message news:Oq**************@TK2MSFTNGP10.phx.gbl... Isn't System.Configuration.ConfigurationSettings.AppSett ings hard-wired to read from web.config if you're writing a web application? re:
Are you talking about a Windows Forms app.config ?
Windows applications in the .NET Framework use the name app.config by default for their configuration file.
Web applications use web.config by default for the configuration file.
ACK.
But what about his question?
Should I ignore the warring messages for "string sConnString = System.Configuration.ConfigurationSettings.AppSe ttings["dsn"];" ?
Sounds like you are saying you should ingore the warnings and continue to use ConfigurationSettings.AppSettings for reading from web.config and app.config files. This is the first time I've heard somebody suggest that. I was under the impressions that ConfigurationSettings.AppSettings was obsolete and should be avoided in favor of the new ConfigurationManager.AppSettings.
Greg
inline
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u0**************@TK2MSFTNGP10.phx.gbl... re: ConfigurationSettings.AppSettings was obsolete and should be avoided in favor of the new ConfigurationManager.AppSettings It is *deprecated*, not obsolete.
The warning VS gives is "obsolete".
You can *still* read web.config values with ConfigurationSettings.AppSettings.
At some point in the future, though, it will stop working. (.Net Framework 3.0 ?)
re: Sounds like you are saying you should ingore the warnings and continue to use ConfigurationSettings.AppSettings for reading from web.config and app.config files. Like I said, app.config is for Windows Forms, and web.config is for web applications.
Yes, of course.
He said he was using app.config, but this is a web applications newsgroup.
If he is getting warnings when he uses app.config in a web application, then he should, simply, only use app.config for Windows applications, and use web.config for web applications.
You get the warning in both Windows apps and Web apps when you use
ConfigurationSettings.AppSettings
Greg
re: The warning VS gives is "obsolete".
It's still deprecated, not obsolete.
When something is obsolete, it doesn't works any more.
When something is deprecated, it still works.
re: You get the warning in both Windows apps and Web apps when you use ConfigurationSettings.AppSettings
I *never* get that warning neither in 1.1 nor in 2.0 web apps.
Maybe I'm just lucky ?
See an example at my test application, configured for ASP.NET 2.0: http://asp.net.do/test/checkAppSettings.aspx
All that page has is :
checkAppSettings.aspx :
-------------------------
<script language="vb" runat="server">
Sub Page_Load()
Dim miSELECT as String = (ConfigurationSettings.AppSettings("selectDocs"))
setting.text = miSELECT
Dim miVersion as String = System.Environment.Version.ToString()
version.Text = "This application is running under ASP.NET version " & miVersion
End Sub
</script>
<html>
<head><title>Retrieve AppSetting key and ASP.NET Version</title></head>
<body>
<asp:label id="setting" runat="server" /><br/>
<asp:label id="version" runat="server" /><br/>
</body>
</html>
------------------------
The key in web.config reads like this :
<appSettings>
<add key="selectDocs" value="SELECT * FROM documents WHERE thereisdata ORDERBY
CreationDate DESC"/>
</appSettings>
Why am I not getting any warnings,
and why does that page compile OK if, as you say :
You get the warning in both Windows apps and Web apps when you use ConfigurationSettings.AppSettings
?
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl... inline
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:u0**************@TK2MSFTNGP10.phx.gbl... re: ConfigurationSettings.AppSettings was obsolete and should be avoided in favor of the new ConfigurationManager.AppSettings
It is *deprecated*, not obsolete.
The warning VS gives is "obsolete".
You can *still* read web.config values with ConfigurationSettings.AppSettings.
At some point in the future, though, it will stop working. (.Net Framework 3.0 ?)
re: Sounds like you are saying you should ingore the warnings and continue to use ConfigurationSettings.AppSettings for reading from web.config and app.config files.
Like I said, app.config is for Windows Forms, and web.config is for web applications.
Yes, of course.
He said he was using app.config, but this is a web applications newsgroup.
If he is getting warnings when he uses app.config in a web application, then he should, simply, only use app.config for Windows applications, and use web.config for web applications.
You get the warning in both Windows apps and Web apps when you use ConfigurationSettings.AppSettings
Greg
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u$**************@TK2MSFTNGP09.phx.gbl... re: The warning VS gives is "obsolete". It's still deprecated, not obsolete.
When something is obsolete, it doesn't works any more. When something is deprecated, it still works.
Okay, okay. :) re: You get the warning in both Windows apps and Web apps when you use ConfigurationSettings.AppSettings
I *never* get that warning neither in 1.1 nor in 2.0 web apps. Maybe I'm just lucky ?
We'll you definately would never see it in 1.1, because this is a compiler
warning in VS 2005 for .NET 2.0.
No clue, why you don't see it in VS 2005. I see it in both my code bedhind
and in-line in the .aspx if I do like your example.
You must be lucky. :)
Did you perhaps turn off this warning in an option somewhere?
Greg
re: We'll you definately would never see it in 1.1, because this is a compiler warning in VS 2005 for .NET 2.0.
It's a 2.0 app.
However, VS 2005, or the .Net compiler team, may be schizophrenic.
On the one hand VS 2005 says that a class is "obsolete",
but it runs OK and it compiles without errors.
Maybe the documentation guys flubbed this one ?
What the warning message should say is that the class
has been "deprecated", but that it compiles and runs OK.
When something is obsolete, it doesn't work any more.
When something is deprecated, it still works.
Not your fault, and not my fault, but I tend to take
these documentation flubs with a little grain of salt.
;-)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... "Juan T. Llibre" <no***********@nowhere.com> wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl... re: The warning VS gives is "obsolete".
It's still deprecated, not obsolete.
When something is obsolete, it doesn't works any more. When something is deprecated, it still works.
Okay, okay. :)
re: You get the warning in both Windows apps and Web apps when you use ConfigurationSettings.AppSettings
I *never* get that warning neither in 1.1 nor in 2.0 web apps. Maybe I'm just lucky ?
We'll you definately would never see it in 1.1, because this is a compiler warning in VS 2005 for .NET 2.0.
No clue, why you don't see it in VS 2005. I see it in both my code bedhind and in-line in the .aspx if I do like your example.
You must be lucky. :)
Did you perhaps turn off this warning in an option somewhere?
Greg
Interesting read http://www.gotdotnet.com/team/change...soletefaq.aspx
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uU**************@TK2MSFTNGP12.phx.gbl... re: We'll you definately would never see it in 1.1, because this is a compiler warning in VS 2005 for .NET 2.0.
It's a 2.0 app.
However, VS 2005, or the .Net compiler team, may be schizophrenic.
On the one hand VS 2005 says that a class is "obsolete", but it runs OK and it compiles without errors.
Maybe the documentation guys flubbed this one ?
What the warning message should say is that the class has been "deprecated", but that it compiles and runs OK.
When something is obsolete, it doesn't work any more. When something is deprecated, it still works.
Not your fault, and not my fault, but I tend to take these documentation flubs with a little grain of salt.
;-) Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ======================================
Thanks, Greg.
Interesting, indeed.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Interesting read
http://www.gotdotnet.com/team/change...soletefaq.aspx
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:uU**************@TK2MSFTNGP12.phx.gbl... re: We'll you definately would never see it in 1.1, because this is a compiler warning in VS 2005 for .NET 2.0.
It's a 2.0 app.
However, VS 2005, or the .Net compiler team, may be schizophrenic.
On the one hand VS 2005 says that a class is "obsolete", but it runs OK and it compiles without errors.
Maybe the documentation guys flubbed this one ?
What the warning message should say is that the class has been "deprecated", but that it compiles and runs OK.
When something is obsolete, it doesn't work any more. When something is deprecated, it still works.
Not your fault, and not my fault, but I tend to take these documentation flubs with a little grain of salt.
;-) Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ======================================
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Arsen Vladimirskiy |
last post by:
Hello,
If I have a few simple classes to represent Entities such as Customers and
Orders.
What is the proper way to pass information to the Data Access Layer?
1) Pass the actual ENTITY to...
|
by: Simon Harvey |
last post by:
Hi,
In my application I get lots of different sorts of information from
databases. As such, a lot of information is stored in DataSets and DataTable
objects.
Up until now, I have been passing...
|
by: Mythran |
last post by:
I have 2 assemblies (for example). Assembly A references assembly B. If I
have a value in assembly A that I want to be used in assembly B, how can I
store it so that assembly B can access it...
|
by: Stuart Hilditch |
last post by:
Hi all,
I am hoping that someone with some experience developing nTier apps can give
me some advice here.
I am writing an nTier web app that began with a Data Access Layer (DAL),
Business...
|
by: Jeff |
last post by:
I have a main project which references several DLLs. Each DLL will
access the same database as the main project. I'm storing the
connection string within the main project's "web.config" file, so...
|
by: alaytin |
last post by:
Hello-
I am having a problem with a Web Service written in Visual Studio 2005.
I have a typed dataset that I created using the Visual Studio 2005
Data Source tool. This retrieves its data from...
|
by: MS newsgroup |
last post by:
I don't have clear reasons why we need business logic layer and data logic
layer instead of having only data logic layer.
Are there any good reasons for that?
|
by: Stimp |
last post by:
I am creating a DLL in VS.NET that will be used on .net and asp
websites.
What is the best way to pass a SQL connection string into the class
methods?
I can't use the web.config method since...
|
by: grawsha2000 |
last post by:
Greetings,
I am developing this N-tier business app. The problem I'm facing is
when I try to pass business objects (employees, dept..etc) from
business tier to data tier,i.e., the add method in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
| |