Solved

ODBC Connecion string for MSSQL 2010 server  using DSN

Posted on 2013-06-23
9
478 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 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 100 total points
Comment Utility
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 200 total points
Comment Utility
ODBC Connections for all Databases here:

http://connectionstrings.com/

it's like MS SQL 2008

Regards
0
 

Author Comment

by:pclarke7
Comment Utility
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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
Comment Utility
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 68

Assisted Solution

by:Qlemo
Qlemo earned 100 total points
Comment Utility
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 200 total points
Comment Utility
0
 

Author Comment

by:pclarke7
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now