connection strings

yaniv

Well-known member
Joined
Apr 15, 2002
Messages
162
Location
israel
I have problems in understang connection strings. what do they use for? (i can see it in samples but cant understand why they are there)
should i build my own connection strings or should i use only tamplets?
 
Connection Strings

The primary property associated with a connection object is the ConnectionString property, which consists of a string with attribute/value pairs for information required to log on to a database and point to a specific database. A typical ConnectionString property might look like the following:

Code:
Provider=SQLOLEDB.1;Data Source=MySQLServer;Initial Catalog=NORTHWIND;Integrated Security=SSPI
This particular connection string specifies that the connection should use Windows integrated security (NT authentication). A connection string can instead include a user id and password, but this is generally not recommended, because these attributes are then compiled into your application and therefore a potential security breach. For more information, see Security Model.

The most common attribute/value pairs used by OLE DB are also represented separately by an individual property, such as DataSource and Database (and, optionally, UserId, and Password). When working with a connection object, you can either set the ConnectionString property as a single string, or you can set individual connection properties. (If your data source requires connection-string values that are not represented by individual properties, then you must set the ConnectionString property.) Alternatively, you can also set the ConnectionString property to the path of a Microsoft Data Link (.udl) file.
 
Back
Top