app.config Connection string

  • Thread starter Thread starter Joao Livio
  • Start date Start date
J

Joao Livio

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>
 
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();
 
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
 
Back
Top