back up codes

always have a backup of your code

Archive for the tag “server connection”

connection string

Before a database table can be accessed, a connection string must be created first. A connection string is used to access different data sources (MS SQL Server, MS Access, Oracle database). On the web.config file, an attribute can be configured to suit the connection to a particular database.

A new connection string can be added using the following format (this sample is connecting to an MS SQL Server):

add name="connString" connectionString="Data Source="";Initial Catalog="";Persist Security Info=True;User ID=username;Password=password" providerName="System.Data.SqlClient"/

Data Source is the machine name running the server, Initial Catalog is the name of the server, Persist Security Info should be set to True

On the .vb pages the connection string can be used with the following instantiation:

Dim connection As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("connString").ConnectionString)

Post Navigation

Follow

Get every new post delivered to your Inbox.