Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to Connect to Database with ODBC and whats the diffrence

Posted on 2007-11-23
3
Medium Priority
?
313 Views
Last Modified: 2010-04-23
Hello guys,
                   whats the diffrence between ODBC and ADO.net, which are better, and is there any sample code of ODBC for vb.net 2005 (insert, delete,update, and select) .
Best regards
0
Comment
Question by:saudiprogrammer
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20341853
ODBC is older and slower than ADO.net, but first allow you to connect to lots of database engines because it is independent of programming languages, database systems, and operating systems. ADO.net has ben specifically designed for the .net framework.

For an example of ODBC with vb.net, have a look to:
http://support.microsoft.com/kb/310985
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 total points
ID: 20341854
0
 
LVL 14

Expert Comment

by:cuziyq
ID: 20341877
ODBC is an open set of standards that allow access to many different kinds of data sources (including databases like Oracle and MS SQL Server, file-based databases like Access or dBase, or even Excel and XML files).  Any data source that has an ODBC driver can be accessed using the same set of APIs with minimal rewriting of code.  Another advantage to ODBC is that it is available on all platforms (UNIX, Mac, and others), not just Windows.  A module written in C++ using the ODBC API can be ported very easily between platforms.

A major drawback to ODBC is that many custom features of database systems such as Oracle or MS SQL Server are not implemented in the ODBC API because they are specific to that company's product (although for a beginner, this will not be an issue).

ADO.NET is a Microsoft proprietary technology that is primarily used to interact with (obviously) other Microsoft products -- especially MS SQL Server.  ADO.NET's advantage is that modules written in .NET can be used in any of the .NET languages, and ADO.NET based database modules can be recompiled and implemented without having to register DLLs or reboot the web server.  .NET also makes heavy use of DCOM, which allows programs to communicate with each other.  Basically, that means that companies that make financial software, for example, can have their web site use the same database as their desktop product, or their inventory product.

The drawback to ADO is of course that it is proprietary M$ software.  It only works on Windows, and if Microsoft ever decides to deprecate it, you're out of luck.  This has happened before with their technologies such as OLE DB and MDAC (which were former database access technologies given up in favor of ADO).  The official M$ position is that new programs should not be written in OLE DB.  Microsoft will continue to support it (for a while, at least), but no new features will be added.  If you wrote your program with OLE DB tools, you're basically stuck rewriting your software if you want it to continue to be used in the future.

So basically your choices are an open standard but with a little more work to use some of the features, or a totally proprietary system, but with more flexibility and faster coding time.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

824 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