473,320 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Database Connectivity using DSN

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
3 3441
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: SectorUnknown | last post by:
I've written a database (Access mdb) front-end using Python/wxpython/and ADO. However, the scope of the project has changed and I need to access the same data on an MSSQL server. Also, the...
3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
1
by: harish | last post by:
I am using java applications to connect to my MS SQL Server database. I am using ODBC for database connectivity. If i am running my java applications in a remote PC and try to connect to database...
3
by: junaid | last post by:
Hi to all, Can it is possible to connect to the databse like postgre or mysql through a C programm? I know the basics of C and I have developed a small program which uses a file for the...
8
by: David | last post by:
Hi, Could someone please xplain how to add a field to an existing SQL table in VB.Net I have added the field in the Server Explorer and it shows up when I reload the program but I cannot...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
47
by: Ivan Weiss | last post by:
Hi all, I am just getting started on a new app and am a rusty VB6 guy who is looking to create something on the side to serve as a corporate workbench for my company. ADO.net is new to me so...
0
by: dalaimanoj | last post by:
I have a form with buttons 'View', 'Save', 'Delete', 'Edit' and some textboxes to input data.. On clicking each buttons the database is connected and the respective action is done. For example...
4
by: ykhamitkar | last post by:
Hi there, I am trying to create a web based dataentry application in java applet. When I create a standalone application using applet the database connectivity works fine. However when I use same...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.