spacer
spacer

Visual Basic & VB.NET resources | VBprofs.com

Google
 
Main Menu
Home
IT News
Articles
Source Codes
Books
Calendar of Events
Publish your Content
Links Directory
Reviews and Recs
Premium Content
 VBprofs Premium Content Become a member to get access to our premium content! 

 Membership is entirely free, and allows you to:
  •  access programming projects posted by our partners;
  •  publish your articles, news, links;
  •  publish a project request;
  •  access our VB Careers section.
Polls
How did you reach VBprofs.com?
  
Which is your favorite programming language?
  
Related Items
 
Home arrow Articles arrow Visual Basic / .NET Articles arrow Connecting and Accessing Data through ADO.NET

Connecting and Accessing Data through ADO.NET PDF Print E-mail
Articles - Visual Basic / .NET Articles
Written by Pawan Bangar   
.NET
Microsoft's ADO.NET technology offers a solution to many of the problems associated with data access.

Accessing data has become a major programming task for modern software programming, both for standardalone applications and for web based applications. Microsoft's ADO.NET technology offers a solution to many of the problems associated with data access.

ADO.NET is an improvement to Microsoft ActiveX Data Objects (ADO). It is a standards-based programming model for creating distributed data-sharing applications. ADO.NET offers several advantages over previous versions of ADO and over other data access components. These benefits fall into the following categories:

Interoperability
Maintainability
Programmability
Performance.


Connecting to a database:

For performing and operation we need to connect to a database. This is done automatically through ADO connection, of which code is associated with VS.net Programming environment.


Connecting Database
sharp1.cs class xyz1 {
public static void main()
{
try
{
System.Data.ADO.ADOConnection s;
S=new System.Data.ADO.ADOConnection();
System.Console.Writeline("C-Sharp);
}
catch(System.Exception e)
{
System.console.Writeline(e.ToString());
}}}


Above program can be compiled through command line at DOS promot giving command line option as /r:System.Data.Dll because the code for ADO.Connection is available at this DLL. The above program consists of an object s resembling as System.ado.adoconnection.


Thus we are creating the object s by the statement:

System.Data.ADO.ADOConnection s;


From the output it is clear that the constructor has thrown no exception, as otherwise catch block would have been executed.

About The Author

Presently working in the capacity of the Technical Director of Birbals, an e-consulting firm based in India dedicated in providing innovative and effective web, Hospitality and consultancy services to public, private and non-profit organizations. Successfully founded Birbals and other IT companies like Ebirbals and SeoBirbals.

< Prev

 
Antivirus Shop
BitDefender Antivirus v10
Newsflash

PowerRefresh 1.0 released!
A simple yet extremely useful tool for webmasters, publishers and SEO working bees: PowerRefresh allows you to automatically refresh your IE windows every x minutes. It can handle unlimited number of windows and, unlike similar applications, is using full browsers.


Get PowerRefresh from Kaloyani.com: download
Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one
Popular

VBprofs.com - online resources for Visual Basic and VB.NET professionals: Visual Basic and VB.NET articles, industry news and events, career tools, VB / VB.NET books, calendar and much more. VBprofs.com is an interactive web site with free membership.
(c) Copyright 2005 - 2006 by VBprofs.com
powered by Mambo Open Source Software
spacer