Database Connectivity using DSN

N

Niks

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.
 
K

Kevin Spencer

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.
 
K

Kenneth Keeley

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

Thanks
Kenneth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top