For Sales Enquiry, call: +91 789 216 9998 For HR Enquiry, call: +91 804 166 0003 Skype: globussoftsupport

Progressing towards Innovation...

 

Connecting Databases in ADO.NET - Globussoft

June 25, 2014by GLBADMIN20

Hi, I am Sumit Gupta. I am a .Net Developer with about 4 years of experience. I have built various applications for both Desktop & Web besides designing Wrapper classes for managing Multi-threading. I would like to share the concept of ADO.NET with you all.

ADO.NET Overview

ADO.NET provides consistent access to data sources such as SQL Server and XML, and to data sources exposed through OLE DB and ODBC. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, handle, and update the data that they contain. 

Connected Architecture of ADO.NET

The architecture such as ADO.net, in which connection must be opened to access the data retrieved from database, is called as connected architecture. Connected architecture is built on the classes’ connection, command, data reader and transaction.

 

Connection: The purpose of connection is to just establish a communication channel to the database, connection itself would not transfer any data automatically.

Command:After establishing a connection to a data source, you can execute commands and return results from the data source using a DbCommand object. You can create a command using one of the command constructors for the .NET Framework data provider you are working with. Constructors can take optional arguments.

Data Reader: Data Reader is used to store the data retrieved by command object and make it available for .NET application. Data in Data Reader is read only and within the Data Reader you can navigate only in forward direction and it also only one record at a time.

To access one by one record from the Data Reader, call Read() method of the Data Reader whose return type is bool. When the next record was successfully read, the Read() method will return true otherwise false.

Transaction: Transactions are groups of database commands that execute as a package. Using a transaction gives your application the ability to abort (roll back) all changes executed from within the transaction if any errors occur during any part of the transaction process.

Disconnected Architecture of ADO.NET

 

Data Adapter: Data Adapter is used to transfer the data between database and dataset. It has commands like select, insert, update and delete. Select command is used to retrieve data from database and insert, update and delete commands are used to send changes to the data in dataset to database. It needs a connection to transfer the data.


Command Builder: 
By default, data adapter contains only the select command and it doesn’t contain insert, update and delete commands. To create insert, update and delete commands for the data adapter, command builder is used. It is used only to create these commands for the data adapter and has no other purpose.

DataSet: Dataset is used to store the data retrieved from database by data adapter and make it available for .net application.

To fill data into dataset fill() method of data adapter is used and has the following syntax> Da.Fill(Ds,”TableName”);

When fill method was called, data adapter had opened a connection to database, had executed select command, had stored the data retrieved by select command in to dataset and had also immediately closed the connection.

As connection to database was closed, any changes to the data in dataset wasn’t directly sent to the database and changes were made only in the dataset. To send changes made to data in dataset to the database, Update() method of the data adapter is used that has the following syntax> Da.Update(Ds,”Tablename”);

When Update method is called, data adapter will again open the connection to database, executes insert, update and delete commands to send changes in dataset to database and immediately closes the connection. As connection is opened only when it is required, the connection will be automatically closed when it was not required, this architecture is called disconnected architecture.

DataView: DataView is a view of table available in DataSet. It is used to find a record, sort the records and filter the records. By using DataView, you can also perform insert, update and delete as in case of a DataSet.A dataset can contain data in multiple tables.

So this is how ADO.NET provides consistent access to data sources such as SQL Server and XML, and to data sources exposed through OLE DB and ODBC.

Thanks for reading. Please share your ideas on our talk on ado.net here.

GLBADMIN

20 comments

  • wtofnnvgjn

    July 22, 2020 at 8:03 pm

    Muchas gracias. ?Como puedo iniciar sesion?

    Reply

  • Wally

    August 22, 2020 at 7:14 am

    You could certainly see your enthusiasm in the article you write.

    The arena hopes for more passionate writers such as you
    who are not afraid to say how they believe.
    Always go after your heart.

    Reply

  • Judi poker online

    August 22, 2020 at 1:00 pm

    I am in fact happy to read this blog posts which includes plenty of helpful facts, thanks for providing these
    kinds of statistics.

    Reply

  • live chat

    August 23, 2020 at 2:52 pm

    wonderful points altogether, you just gained a logo new reader.
    What might you recommend about your submit that you just made
    a few days in the past? Any certain?

    Reply

  • Seymour

    August 23, 2020 at 6:21 pm

    Hello, its pleasant article about media print, we all know media
    is a fantastic source of facts.

    Reply

  • Definitely believe that which you said. Your favorite justification appeared
    to be on the internet the easiest thing to be aware of.
    I say to you, I certainly get irked while people consider worries that they just don’t know about.
    You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people
    can take a signal. Will likely be back to get more.
    Thanks

    Reply

  • Lionel

    August 24, 2020 at 1:51 pm

    Touche. Solid arguments. Keep up the amazing spirit.

    Reply

  • business

    August 24, 2020 at 3:10 pm

    Thank you for the good writeup. It in fact was
    a amusement account it. Look advanced to far added agreeable from you!

    By the way, how could we communicate?

    Reply

  • Maurice Kinsel

    August 25, 2020 at 8:01 am

    Wonderful beat ! I would like to apprentice while you amend your site, how can i subscribe for a blog site? The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear idea

    Reply

  • Leonie

    August 26, 2020 at 9:41 am

    Having read this I believed it was rather enlightening. I appreciate you finding the time and effort
    to put this content together. I once again find myself spending way too much time
    both reading and posting comments. But so what, it was still worthwhile!

    Reply

  • newest movies out

    August 27, 2020 at 2:42 am

    I know this web site offers quality depending articles or reviews and extra
    information, is there any other web site which offers these kinds
    of information in quality?

    Reply

  • watch newest movies out

    August 27, 2020 at 3:15 am

    I’m now not certain the place you are getting your info, however
    good topic. I needs to spend a while learning
    more or figuring out more. Thanks for wonderful info I used to be on the lookout for
    this info for my mission.

    Reply

  • Tegan

    August 27, 2020 at 6:35 am

    I have to thank you for the efforts you have put
    in writing this blog. I’m hoping to see the same high-grade content by you in the future as well.
    In truth, your creative writing abilities has inspired
    me to get my very own site now 😉

    Reply

  • how to watch free putlocker movies

    August 30, 2020 at 8:58 pm

    After checking out a number of the blog articles on your web site, I truly like your technique of writing a blog.
    I book-marked it to my bookmark webpage list and
    will be checking back in the near future. Please visit my
    web site as well and let me know your opinion.

    Reply

  • how to watch free putlocker movies

    August 31, 2020 at 10:22 pm

    I think the admin of this site is truly working hard in support of his web page, since here every data is quality based information.

    Reply

  • thegildedmint.com

    September 1, 2020 at 12:29 pm

    Howdy! Someone in my Facebook group shared this site with us so I came
    to give it a look. I’m definitely loving the information. I’m book-marking and will be tweeting this to
    my followers! Superb blog and terrific design and style.

    Reply

  • الخليج العربي

    September 13, 2020 at 5:38 pm

    Way cool! Some very valid points! I appreciate you penning
    this post and also the rest of the website is extremely good.

    Reply

  • Bigg Boss 14 Online

    September 15, 2020 at 4:36 pm

    My spouse and I stumbled over here different page and thought I should check things out.
    I like what I see so now i am following you. Look forward to looking
    at your web page again.

    Reply

  • I am really impressed with your writing skills and also with the layout
    on your weblog. Is this a paid theme or did you customize it yourself?
    Anyway keep up the excellent quality writing, it’s
    rare to see a great blog like this one nowadays.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Globussoft
Social Networks
globussoftsupport
support@globussoft.com

Copyright © 2006-2020 Globussoft Technologies

ss
top