SQL Native Client 10 Connection String in .NET Framework

In this article, I will explain How to create SQL Native Client 10 Connection String in .NET Framework
  • 2282

SQL Native Client 10.0 ODBC Drive in .NET

Introduction

  • SQL Native Client 10.0 ODBC driver is contained in the file sqlncli10.dll.

  • SQL Server Native Client 10.0 ODBC Driver was released with SQL Server 2008 and can access SQL Servers from 7.0 and above.

  • SQL Native Client ODBC driver communicate with SQL Server through function calls.

  • SQL Server-specific versions of the ODBC functions are implemented in the SQL Native Client ODBC driver.

  • The SQL Native Client ODBC driver complies with the Microsoft Win32 ODBC 3.51 specification. 

Standard security

To create connection string  with standard security in SQL server native client 10.0 ODBC Driver. we need to put Driver, your server address, your database name, your user name and your password. 

Driver={SQL Native Client};Server=UrServerAddress;Database=UrDataBase; Uid=UrUsername;Pwd=UrPassword;

Trusted Connection

To create trusted connection in SQL server native client 10.0 ODBC Driver. we need to put Driver, your server address, your database name, set the state of Trusted connection to Yes.

Driver={SQL Native Client};Server=UrServerAddress;Database=UrDataBase; Trusted_Connection=yes;

Prompt for username and password

This one is a bit tricky. we need to set the connection object's Prompt property to adPromptAlways. Then use the connection string to connect to the database

oConn.Properties("Prompt") = adPromptAlways
Driver={SQL Native Client};Server=UrServerAddress;Database=UrDataBase;

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.