Re: app.config Connection string by msnews
msnews
Wed Aug 06 22:31:01 CDT 2008
I'm struggeling with the same question. As I understand, the
ConnectionString can not be set to User Scope. Is there any other way to
handle this problem?
As I understand, the ConnectionString property of the table adapter's
connection is coded either as string or as
Global.[Project].MySettings.[ConnectionString].
I thought about having a new user scope variable in MySettings holding the
connection string (of type String, since it's not possible to hold it as
ConnectionString type), but this would mean that I would have to adopt the
InitConnection Method of every TableAdapter.
Many thanks for your suggestions,
Etienne
"Sami Marzouki" <Sami Marzouki@discussions.microsoft.com> wrote in message
news:D4532708-8C16-4B3E-B878-A6EB89074FB8@microsoft.com...
> Hi,
> you could set your connectionstrings to User Scope and then binding a
> textbox to your app.config, and after changes call
> Settings.Default.Reload();
>
>
>
> "Joao Livio" wrote:
>
>> Hi to all,
>>
>> How can i change at design time My.MySettings.ESTConnectionString?, the
>> problem is that the Server and Instance can change when i run the program
>> for the first time, i am intending to build a form in order to users
>> change
>> this parameters (Connection String, User and Password)
>>
>> Thanks very much for helping
>> Joao
>>
>> <connectionStrings>
>> <add name="appCHSocial.My.MySettings.ESTConnectionString"
>> connectionString="Provider=SQLOLEDB;Data
>> Source=DOTNET-PC\SQLExpress;Initial
>> Catalog=xxx;User Id=sa;Password=xxx;"
>> providerName="System.Data.Sql" />
>> </connectionStrings>
>>