PC Review


Reply
Thread Tools Rate Thread

Re: Connection string setting for DataAdapter

 
 
Pete Wright
Guest
Posts: n/a
 
      22nd May 2004
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>


 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the connection string to a QueryTable.refresh Candyman Microsoft Excel Programming 1 27th Jun 2009 07:38 AM
DataAdapter is not using correct connection string Andi Microsoft ADO .NET 3 5th May 2005 06:59 PM
dataadapter wizard connection string =?Utf-8?B?am9obiBzbWl0aGVycw==?= Microsoft ASP .NET 5 6th Sep 2004 04:08 PM
Re: SQL Connection String - Setting ANSI NULLS to OFF William \(Bill\) Vaughn Microsoft ADO .NET 4 12th Jul 2004 08:24 PM
Re: Connection string setting for DataAdapter Carl Prothman [MVP] Microsoft ADO .NET 0 23rd May 2004 07:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:56 AM.