Share datasource among programs

  • Thread starter Thread starter Matthew
  • Start date Start date
M

Matthew

I have written many small apps that use one MSSQL database.
Too late, I realized a problem. The connection is hard coded in each
app. And it's time to upgrade my server!
To keep this from haunting me in the future, is there a way to specify
a database connection in a central location?

Matthew
 
Matthew,

You can store it everywhere. Version 2.0 does it now with the designer
generated database parts in the app.config file.

\\\\
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add
name="WindowsApplication4.My.MySettings.NorthwindConnectionString"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\test1\Northwind.mdb"
providerName="System.Data.OleDb" />
</connectionStrings>
etc.
///

I hope this helps,

Cor
 

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

Back
Top