.NET Framework Data Provider for SQL Server
Standard Security
Data Source=ServerName;Initial Catalog=DatabaseName;User Id=UserName;Password=Password;
Data Source=ServerName;Initial Catalog=DatabaseName;User Id=UserName;Password=Password;
Standard Security alternative syntax
Server=ServerName;Database=DatabaseName;User ID=UserName;Password=Password;Trusted_Connection=False;
Server=ServerName;Database=DatabaseName;User ID=UserName;Password=Password;Trusted_Connection=False;
Trusted Connection
Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=SSPI;
Connecting to an SQL Server instance
Server=ServerName\theInstanceName;Database=DatabaseName;Trusted_Connection=True;
Trusted Connection from a CE device
Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=SSPI;User ID=myDomain\UserName;Password=Password;
Note: This will work on a CE device only.
Connect via an IP address
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=DatabaseName;User ID=UserName;Password=Password;
DBMSSOCN=TCP/IP.
Note: 1433 is the default port for SQL Server.
Microsoft OLE DB Provider for SQL Server
Standard Security
Provider=sqloledb;Data Source=ServerName;Initial Catalog=DatabaseName;User Id=UserName;Password=Password;
Trusted connection
Provider=sqloledb;Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=SSPI;
Connecting to an SQL Server instance
Provider=sqloledb;Data Source=ServerName\theInstanceName;Initial Catalog=DatabaseName;Integrated Security=SSPI;
Connect via an IP address
Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=DatabaseName;User ID=UserName;Password=Password;
DBMSSOCN=TCP/IP.
This use to connect the SQL Server Database via internet connection.
1 comments:
This post doesn't include anything with which you are not familiar. It includes connection strings which we use in .Net. The syntax for the connection is very easy. It’s very simple for the .Net users. Thanks for combining all connection string at one place.
Post a Comment