Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ODBC Connecion string for MSSQL 2010 server  using DSN

Posted on 2013-06-23
9
Medium Priority
?
510 Views
Last Modified: 2013-07-02
Hello,
I have successfully set up ODBC connection strings from my C# application to a DB2 database and to excel spreadsheet using DSN

DB2 connection string= "DSN=MyDSNname; UID=Myname; PWD=Mypassword;"

EXCEL Connection string = "DSN= MyDSNName; Data Source=C:\MySpreadSheet.xls; HDR=yes; Format=xls;"

I now need to create an ODBC connection to a MS SQL 2010 database using a DSN. Can anyone please tell me the format of this connection string ?

regards
Pat
0
Comment
Question by:pclarke7
9 Comments
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 300 total points
ID: 39269497
If you're writing code in C#, why would you want to use DSN? You'd have to set it up on each machine that runs your application.

Connection strings for SQL Server can be found here:  http://www.connectionstrings.com/
0
 
LVL 4

Assisted Solution

by:BAKADY
BAKADY earned 600 total points
ID: 39269498
ODBC Connections for all Databases here:

http://connectionstrings.com/

it's like MS SQL 2008

Regards
0
 

Author Comment

by:pclarke7
ID: 39269579
Thanks for your inputs. I have gone to connectionstrings.com but there doesn't seem to be any examples under 2008 using DSN.  They are all looking at supplying the server address like the example below:

Server=myServerAddress;Database=myDataBase;User Id=myUsername; Password=myPassword;

I have set up an ODBC data source and would like to connect through this.

regards
Pat
-
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 300 total points
ID: 39269638
You might want to look at this page: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/9d7799a3-2850-43ce-acea-2a43cbe20c9d/dsn-with-sqlconnection  Using a DSN may be possible but it is not the preferred method with SQL Server.  SQL Native Client is the driver that provides all the connections anyway, both ODBC and OLEDB.
0
 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 300 total points
ID: 39269902
If you use ODBC, be aware that you won't get full support - that is you can't use e.g. several new datatypes and extended features.
0
 
LVL 4

Accepted Solution

by:
BAKADY earned 600 total points
ID: 39270451
0
 

Author Comment

by:pclarke7
ID: 39290818
Whilst I appreciate the input of all of those who gave answers, none of the answers gave me what I was looking for. I am still unable to like to MS SQL via ODBC. I have changed over to native SQL. But at the end of the day I did not get the answers that I was looking for.

regards
 Pat
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

926 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