Creating an SQL connection string in asp.net vb
First you need to create (if one doesn't already exist) called 'web.config'. This file should look something like below:-
<configuration>
<appSettings>
<add key="ConnectionString" value="server=server_name_or_ipaddress;Initial Catalog=database_name;User Id=username;Password=password;" />
</appSettings>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Then in your asp.net vb file use the below:-
Then the below is where you link to the connection string in the 'web.config' file:-
Dim MyConnection As SQLConnection
MyConnection = New SQLConnection(ConfigurationSettings.AppSettings("ConnectionString"))