how to connect to a database by DSN configuration?

  • Thread starter Thread starter Linda Chen
  • Start date Start date
L

Linda Chen

I can make my connection work by paasing "privider", "data
source", "Initial Catalog
"... to my connection string. Here is my sample:

"Provider=SQLOLEDB.1;Integrated Security=SSPI;Data
Source=MyMachine\\MySQLSERVER;Initial Catalog=MyDB;"

How do I connection to my database by using my DSN
configuration?

Thanks.

Linda Chen
 
Hi Linda,

You'll have to use OdbcConnection and a string something like:
"DSN=MS Access Database;DefaultDir=C:\Program Files\Developer Express
Inc\XtraGrid Suite\Demos\XtraGrid\Data;DriverId=25;DBQ=C:\Program
Files\Developer Express Inc\XtraGrid
Suite\Demos\XtraGrid\Data\nwind.mdb;MaxBufferSize=2048;FIL=MS
Access;PageTimeout=5;UID=admin"

Check out www.connectionstrings.com for more info
 
Thanks Miha. Does this mean that I will have to install
ODBC.net?

Anyway to use ado.net?
 
Thanks again, I made it working.
-----Original Message-----
Hi Linda,

You'll have to use OdbcConnection and a string something like:
"DSN=MS Access Database;DefaultDir=C:\Program Files\Developer Express
Inc\XtraGrid Suite\Demos\XtraGrid\Data;DriverId=25;DBQ=C:\Program
Files\Developer Express Inc\XtraGrid
Suite\Demos\XtraGrid\Data\nwind.mdb;MaxBufferSize=2048;FIL =MS
Access;PageTimeout=5;UID=admin"

Check out www.connectionstrings.com for more info

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com





.
 
Back
Top