app.config Connection string

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>
 
S

Sami Marzouki

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();
 
M

msnews.microsoft.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top