?
Solved

SQL server connection

Posted on 2014-01-28
5
Medium Priority
?
309 Views
Last Modified: 2014-01-29
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=10.5.0.1,1433;Initial Catalog=customer;Persist Security Info=True;User ID=JOHN;Password=password" providerName="System.Data.SqlClient"/>
0
Comment
Question by:Varshini S
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:Tony303
ID: 39816775
ODBC.

Sounds and looks like a homework question.
0
 

Author Comment

by:Varshini S
ID: 39816989
System.Data.SqlClient   is  ADO.net provider for SQL Server not ODBC... am I correct ?
0
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39817021
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.
0
 

Author Comment

by:Varshini S
ID: 39818385
For using ODBC connection , I need to use System.Data.Odbc instead of System.Data.SqlClient
in the connecting string. Am I correct ?
0
 
LVL 16

Accepted Solution

by:
Surendra Nath earned 2000 total points
ID: 39818686
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question