You are correct that changes to the .Designer file will be overwritten and
that you wouldn't want to modify it. Right click on your DataSet xsd file in
the solution explorer and select "View Code". A new partial class file will
be created for you (if one doesn't already exist) and you can place your
DataSet extensions safely in this file. Subsequent regenerations and
alterations of your DataSet will not overwrite this file.

--Paul Mehner

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Block, Jeffrey A.
(Jeff)
Sent: Thursday, January 26, 2006 2:25 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] How to Change the Connection String of a Ty
pedDataset Data Source

Paul,

I'd thought of something like that, but was afraid that I didn't want to
mess with anything in the .designer file.  Won't that get overwritten the
next time it gets re-generated?

Partial classes are indeed something I was leaning towards, I just wanted to
make sure I wasn't missing some built-in means.

Thanks for the feedback!


Jeff Block


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Mehner
Sent: Thursday, January 26, 2006 5:05 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] How to Change the Connection String of a
TypedDataset Data Source

The connection can be exposed and set from code by selecting the table
adapter in the designer and changing the Modifier property for the
connection to public or internal from its default of private.

You can also add properties and methods to your partial class for the
dataset if you want to pass in configuration data or extend your datasets in
other manners.

--Paul Mehner


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Block, Jeffrey A.
(Jeff)
Sent: Thursday, January 26, 2006 1:00 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] How to Change the Connection String of a
TypedDataset Data Source

VS 2005, VB.Net

I'm looking for a means of changing the connection string of a typed-dataset
that has been generated by VS 2005 through the data source wizard.  In
reviewing the code, the connection string gets saved as a "setting" for my
application and assigned based on that setting's value.  The setting is
"read-only" since it is an application setting.  Without going against how
VS generates code, is there any way to alter the connection string at
runtime?  The only thing I have come up with so far is change the setting in
the project settings and re-compile, not a real good solution.

Thanks in advance for any thoughts!

Jeffrey A. Block
Sr. Systems Analyst
The Timken Company
[EMAIL PROTECTED]
(330) 471-3268





-----------------------------------------
This message and any attachments are intended for the individual or entity
named above. If you are not the intended recipient, please do not forward,
copy, print, use or disclose this communication to others; also please
notify the sender by replying to this message, and then delete it from your
system. The Timken Company / The Timken Corporation

===================================
This list is hosted by DevelopMentorR  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorR  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to