|
-
Feb 1st, 2007, 05:21 PM
#3
Re: Is it possible to modify the connection string when using a databound project?
Are you saying that you're building a Data Source in the IDE at design time and thus you're using TableAdapters to get your data? If so then each TableAdapter has its own Connection object. You need to go into the DataSet designer, select a TableAdapter and set its ConnectionModifier property to Public. That will allow you to access the Connection property of every TableAdapter in code. You should then create your new connection string in code, probably using the ConnectionStringBuilder class for your data source, then set the Connection.ConnectionString property of each of your TableAdapters. I always declare a SetConnectionStrings method that does just that, which I call from the form's Load event handler.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|