A common way to solve this problem is to write a single function to return a
connection. The function will retrieve the appropriate connection string
from whatever configuration source you are using, and build a connection
object. The connection object can then be set onto the commands in your
dataadapters.
By keeping connection handling code in just one place in your application
you minimize the risk of having to make major changes to your code if
something changes.
--
--------------------------------------------------------
Peter Wright (
www.petewright.org)
Author of ADO.NET Novice To Pro
From Apress.
www.apress.com
"Priya via .NET 247" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
(Type your message here)
Hi,
In our project we have more than 20 DataAdapters. I created connection
parameters in web.config file. If i have to change the connecting string
for all the DataAdapter do i have to manually change in the properties. Is
there any other alternative way to achieve the same. I am expecting a easy
way through which whenever i changed in the web.config all the data adapters
as to point to the same settings.
Thanks for your help.
From: Priya
-----------------------
Posted by a user from .NET 247 (
http://www.dotnet247.com/)
<Id>pobf56+q10Wy0yxekwJhGg==</Id>