Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / January 2006

Tip: Looking for answers? Try searching our database.

Changing Connection in TypedDataset VS2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
michael - 01 Jan 2006 18:25 GMT
I created a a new Data Source within a project of VS2005. I need to move the
database which the Data Source is based on to another server. However, I
can't find a property which allows the Data Source's connection to be changed
(seems that once it's set, the connection can't be altered). Of course the
connection string can be changed at runtime but I want to be able to Refresh
the Data Source/TypedDataset while in the Designer.

Should the connection string be changed by altering the appropriate Data
Connection in the Server Explorer?

Signature

Michael Hockstein

"Gary Chang[MSFT]" - 03 Jan 2006 03:39 GMT
Hi Michael,

>However, I can't find a property which allows the Data Source's
>connection to be changed (seems that once it's set, the
>connection can't be altered). Of course the connection string
>can be changed at runtime but I want to be able to Refresh
>the Data Source/TypedDataset while in the Designer.

Once the datasource is generated by the wizard, it would be integrated into
the target dataset, so there is no such property to change its connection
string in the design time.

On the other hand, since the corresponding connection string has been
stored in the the program's app.config file, I suggest you can modify its
<connectionStrings> entry directly in the  app.config file.

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
michael - 03 Jan 2006 11:04 GMT
If I'm like other developers, when I start a project, the db name and
location may change a couple of times before the project picks up steam.
Using a Data Source whose design time connection properties can't be changed
at this early stage is probably no big deal. But what happens months after
thousands of hours have been devoted to a project? A site change, a need to
change the Data Source location/db, how can this feature not be available at
design time?

I don't always save the connection string to the app.config. I also not sure
if this string is used during Design Time.
Signature

Michael Hockstein

> Hi Michael,
>
[quoted text clipped - 25 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary Chang[MSFT]" - 04 Jan 2006 02:52 GMT
Hi Michael,

>A site change, a need to change the Data Source location/db,
>how can this feature not be available at design time?

The data source is only active during the time when the wizard generates
it, then it would be converted to the xml entry in the app.config or the
corresponding code block of the application, so there is no way to config
the datasouce directly in the design time after it has been created, this
behavior is by design in VS2005.

In this scenario, if you do not want to change the corresponding hard code
in the app.config or the application program, I am afraid you need to
create a new dataset to bind the new datasource, but I think it may be a
more inconvenient approach.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.