PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Re: Connection string setting for DataAdapter

Reply

Re: Connection string setting for DataAdapter

 
Thread Tools Rate Thread
Old 22-05-2004, 09:48 PM   #1
Pete Wright
Guest
 
Posts: n/a
Default Re: Connection string setting for DataAdapter


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" <anonymous@dotnet247.com> wrote in message
news:uUjr2zCQEHA.2468@TK2MSFTNGP11.phx.gbl...
(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>


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off