Minimal information needed by connection string to open connection - ADO.NET

Q.  What is the minimal information needed by a connection string to open a connection to a SQL Server 2000 or SQL Server 2005 database?

1. A valid data source
2. A valid provider name
3. A valid file path
4. Appropriate credentials or Integrated Security settings

- Published on 31 Aug 15

a. 1, 2
b. 1, 2, 3
c. 1, 3
d. 1, 4

ANSWER: 1, 4
 
A valid data source, appropriate credentials or Integrated Security settings needed by a connection string to open a connection to a SQL Server 2000 or SQL Server 2005 database.
Example:
String conString = "Data Source = PC name; Initial Catalog = your DataBasename;
Integrated Security = SSPI;"

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)