• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

SQL server connection

I am using following connection string to communicate to my SQL server from my web server.

What connection mechanism  I am using to communicate to my server ? Please explain.

<add name="mydb" connectionString="Data Source=,1433;Initial Catalog=customer;Persist Security Info=True;User ID=JOHN;Password=password" providerName="System.Data.SqlClient"/>
Varshini S
Varshini S
  • 2
  • 2
1 Solution

Sounds and looks like a homework question.
Varshini SAuthor Commented:
System.Data.SqlClient   is  ADO.net provider for SQL Server not ODBC... am I correct ?
Surendra NathTechnology LeadCommented:
ok, the information you have provided is a connection string, not the way you are trying to connect.

you can use ODBC connection or SQL Connection with the same connection string.
Varshini SAuthor Commented:
For using ODBC connection , I need to use System.Data.Odbc instead of System.Data.SqlClient
in the connecting string. Am I correct ?
Surendra NathTechnology LeadCommented:
that is correct
you have to choose the provider name as ODBC.

for your information

The providerName attribute is used to set the name of the .NET Framework data provider that the DataSource control uses to connect to an underlying data source. If no provider is set, the default is the ADO.NET provider for Microsoft SQL Server.

The .NET Framework includes the following data providers:

The System.Data.SqlClient provider is the default .NET Framework Data Provider for SQL Server.
 System.Data.OleDb provider is the .NET Framework Data Provider for OLE DB.

The System.Data.Odbc provider is the .NET Framework Data Provider for ODBC.
The System.Data.OracleClient provider is the .NET Framework Data Provider for Oracle.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now