MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology


ADO.NET Projects

ADO.NET Project 1

ADO.NET Examples


Dataset object in ADO .NET
Previous Home Next

The DataSet object is a disconnected storage.DataSet is a disconnected in-memory representation of data. It can be considered as a local copy of the relevant portions of the database. The DataSet is persisted in memory and the data in it can be manipulated and updated independent of the database. It represents related tables, constraints, and relationships among the tables. DataSet reads and writes data and schema as XML documents.The DataSet object is a disconnected storage.It is used for manipulation of relational data. The DataSet is filled with data from the storeWe fill it with data fetched from the data store. Once the work is done with the dataset, connection is reestablished and the changes are reflected back into the store.

ADO.NET DataSet can contain more than one table and also contains information about table relationships, the columns they contain, and any constraints that apply. Each table in a DataSet can contain multiple rows. Once data is retrieved from the database into a DataSet object, an application can disconnect from the database before processing the DataSet. This is an important feature of the ADO.NET DataSet. It gives us an in-memory, disconnected copy of a portion of the database which we can process without retaining an active connection to the database server.

Creating and using a DataSet

The typical steps in creating and using a DataSet are:

    (i)Create a DataSet object
    (ii) Connect to a database
    (iii)Fill the DataSet with one or more tables or views
    (iv)Disconnect from the database
    (v)Use the DataSet in the application

Example of DataSet


using System;
using System.Data;
using System.Data.SqlClient;
public class empcount {
public static void Main() {
//change the following connection string, as necessary...
string con ="server=(local)\kamal;
DataSet ds = new DataSet("EmpDataSet");
SqlDataAdapter sad;
string sl;
sl = "SELECT COUNT(*) AS cnt FROM employee";
sad = new SqlDataAdapter(sl, con);
sad.Fill(ds, "emp_count");
sl = "SELECT COUNT(*) AS cnt FROM compocation";
sad = new SqlDataAdapter(sl, con);
sad.Fill(ds, "comploc_count");
int totalemp = (int) ds.Tables
int comploc = (int) ds.Tables
"There are {0} employee, 
     {1} complocation .",
totalemp ,
Previous Home Next