Thursday, March 27, 2014




  • ADO.NET  is  known  as  Database  Technology, which  is  used  to  connect  with  the databases. That means some objects will work for interacting with the databases.
  • Basically,  why  we  require  database  connection  is:  the  frontend  application  itself,  can‘t store  any  data  permanently.  So  that  we  require  a  storage  mechanism.  That  storage mechanism is nothing but our databases.
  • It  can  be  used  for  database  connections  and  offers  to  perform  database  manipulations like inserting data to the tables, deleting un-necessary data, retrieving the required data from the tables etc.
  • It  can  be  used  in  any  type  of  applications  like  console  applications,  windows  forms applications, web sites, web services, WCF services etc.
  • It can be used in any .NET language like C#.NET, VB.NET, VC++.NET etc.
  • It was developed based on its previous version called ADO.
  • It  offers  much  efficient  features  to  easily  handle  with  the  database  tables,  especially when you are dealing with multiple tables.

What type of databases we can connect using ADO.NET:

  • File Databases:
           dBASE, FoxPro, MS Access, MS Excel etc.
  • Server Databases:
           SQL Server, Oracle, My SQL etc.

What we can do using ADO.NET:

  • Insert some data into the database table.
  • Delete some data from the database table.
  • Update the data of a table.
  • Retrieve some data from the table.
  • Execute a stored procedure / function, i.e. already created at backend using PL/SQL.

ADO.NET Database Connection Architecture

Note:  Here,  the  driver  acts  as  mediator  between  the  frontend  application  and  backend databases. The driver can also be called as ―Provider‖. This provider may be released by Backend Company or Frontend Company.
For various databases, we have respective providers.

Understanding the Connection String:

  • The  connection  string  provides  the  details  about  the  connection  string.  That  means,  if you  want  to  connect  with  the  database,  you  have  to  specify  some  details  about  the connection like:
             1.  Server
             2.  User ID
             3.  Password
             4.  Provider
  • Server: Specify the name of the server system, which you want to connect. If you want to  connect  with  other  server  system  on  the  network,  you  specify  the  name  of  that system. Ex: myserver. If you want to connect with the same system, mention the server name as localhost. The server name can also be called as data source.
  • User ID: Specify the user name for logging-in with the database.
  • Password: Specify the password for logging-in with the database.
  • Provider:  Specify  the  name  of  the  driver  /  provider,  which  you  want  to  use  with  the connection. You can see the available provider names, in the above table.
Syntax of Connection String:
     provider=xxxxx; user id=xxxxx; password=xxxx; data source=xxxxx

Note: Just for separation of the individual values, we are using " ; ".


No comments:

Post a Comment