By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,272 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

Database Connectivity using DSN

P: n/a
Hi,
I need to connect to SQL server Database using a System DSN. Can
anyone tell me how to connect to SQL Server using DSN in ASP.NET
(VB.Net). Using a Try Catch block.

Does anyone know how to create a "filename.DSN" file. I know how to
create a system DSN, but my N/W admin has asked me to create a DSN
file to send him. which would be a file name with ".DSN" extension, so
that he can place it on the server.

thanks in advance.
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Why on earth would you want to use a System or File DSN to connect to a SQL
Server?!

First, a System or File DSN uses ODBC (Open Database Connectivity), which is
a wrapper for OLE DB (Object Linking and Embedding for Databases). This
means that your database connectivity will be as slow as possible. You have
2 other choices. One is to use OLE DB, which eliminates the wrapper of ODBC.
The other is to use the native SQL .Net classes (System.Data.SqlClient).
This is the fastest way to connect to a SQL Server with .Net.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Niks" <ar*********@yahoo.com> wrote in message
news:c0**************************@posting.google.c om...
Hi,
I need to connect to SQL server Database using a System DSN. Can
anyone tell me how to connect to SQL Server using DSN in ASP.NET
(VB.Net). Using a Try Catch block.

Does anyone know how to create a "filename.DSN" file. I know how to
create a system DSN, but my N/W admin has asked me to create a DSN
file to send him. which would be a file name with ".DSN" extension, so
that he can place it on the server.

thanks in advance.

Nov 18 '05 #2

P: n/a
Hi,
Could you show a code sample of how to connect to an sql database using
the SQL .net Classes

Thanks
Kenneth

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
Why on earth would you want to use a System or File DSN to connect to a SQL Server?!

First, a System or File DSN uses ODBC (Open Database Connectivity), which is a wrapper for OLE DB (Object Linking and Embedding for Databases). This
means that your database connectivity will be as slow as possible. You have 2 other choices. One is to use OLE DB, which eliminates the wrapper of ODBC. The other is to use the native SQL .Net classes (System.Data.SqlClient).
This is the fastest way to connect to a SQL Server with .Net.


Nov 18 '05 #3

P: n/a
Hi Kenneth,

Here's a link to a whole bunch of samples on the Microsoft MSDN Library:

http://msdn.microsoft.com/library/de...dataadonet.asp

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Kenneth Keeley" <ke*******@hotmail.com.nowhere> wrote in message
news:uS**************@TK2MSFTNGP11.phx.gbl...
Hi,
Could you show a code sample of how to connect to an sql database using
the SQL .net Classes

Thanks
Kenneth

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
Why on earth would you want to use a System or File DSN to connect to a SQL
Server?!

First, a System or File DSN uses ODBC (Open Database Connectivity),

which is
a wrapper for OLE DB (Object Linking and Embedding for Databases). This
means that your database connectivity will be as slow as possible. You

have
2 other choices. One is to use OLE DB, which eliminates the wrapper of

ODBC.
The other is to use the native SQL .Net classes (System.Data.SqlClient).
This is the fastest way to connect to a SQL Server with .Net.


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.