Hi I have added an app.config file and put my connection string into it.
below is the content of the app.config file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="DatabaseConnection"
connectionString="Data Source=ICWSQL2K;Initial Catalog= HACardio;user id=username;password=password;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
I have also added the following to the top of my form;
Imports System.Configuration.ConfigurationSettings
I now need to call my connection string (which is called "DatabaseConnection") in my config file so i can connect to my database. But I am not sure of the syntax. Can anyone please help?
best regards
I am using vs2003 - should I have also used <appsettings> instead of <connectionstrings> in my config file
ICW
below is the content of the app.config file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="DatabaseConnection"
connectionString="Data Source=ICWSQL2K;Initial Catalog= HACardio;user id=username;password=password;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
I have also added the following to the top of my form;
Imports System.Configuration.ConfigurationSettings
I now need to call my connection string (which is called "DatabaseConnection") in my config file so i can connect to my database. But I am not sure of the syntax. Can anyone please help?
best regards
I am using vs2003 - should I have also used <appsettings> instead of <connectionstrings> in my config file
ICW