SlideShare a Scribd company logo
Disconnected Architecture in VB.NET
By:
Ambreen Gillani
VB.NET
Disconnected Architecture
Data Sets, Data Tables, Data Adapters, Stored
Procedures and managing their transections.
Disconnected Architecture in ADO.NET
ADO.NET
 ADO.NET is part of the .NET framework technology that allows
you to access and modify data from different data sources.
 It supports many types of data sources such as Microsoft SQL
Server, MySQL, Oracle, and Microsoft Access.
 The .NET Framework provides a number of data providers that
you can use. These data providers are used to connect to a data
source, executes commands, and retrieve results.
ADO.NET
 ADO.NET was built for a disconnected architecture, so it enables
truly disconnected data access and data manipulation through its
Dataset Object, which is completely independent from the Data
Source.
 The two key components of ADO.NET are Data Providers and Data
Set
 ADO.net uses dataset object for disconnected architecture And
data adapter fills it.
Data Set
DataSet
 The DataSet is the central component in the ADO.NET
Disconnected Data Access Architecture.
 A DataSet is an in-memory data store that can hold multiple
tables at the same time.
 DataSets only hold data and do not interact with a Data Source.
 One of the key characteristics of the DataSet is that it has no
knowledge of the underlying Data Source that might have been
used to populate it.
 DataSet is disconnected architecture gets all records at once
and closes connection and are available even after connection
is closed
 A DataSet is made up of a collection of tables, relationships, and
constraints
DataSet
Syntax:
 The Data Set is not connected directly to a Data Source through a
Connection object when you populate it. It is the Data Adapter that
manages connections between Data Source and Dataset by fill the
data from Data Source to the Dataset and giving a disconnected
behavior to the Dataset.
 The Data Set contains Data Tables. The Data Tables contains Data
Row and Data Columns. A Data Set or a Data Table can be used with
a Command and a Data Adapter object to store query results.
. Program Example for DataSet:
Data Adapter
Data Adapter
 The Data Adapter acts as a bridge between the Disconnected Objects
 Data Adapter is a part of the ADO.NET Data Provider.
 Data Adapter provides the communication between the Dataset and
the Data source.
 We can use the DataAdapter in combination with the DataSet Object.
 The Data Adapter can perform Select , Insert , Update and Delete SQL operations in the
Data Source.
 DataAdapter - A DataAdapter object is used to fill a DataSet/DataTable with query results.
 Syntax:
Dim adapter As New SqlDataAdapter
adapter.SelectCommand = New SqlCommand(sql, sqlCnn)
Dim ds As New DataSet
adapter.Fill(ds)
Data Adapter
Adapter.Update(dataset_variable,”Table_Name”)
 This command is used to update database after working on
dataset.
 This can be thought of as the adapter between the
connected and disconnected data models.
 A Command object will be used to execute the query and
a DataAdapter will use this Command object and fill the
query results coming from the database into
a DataSet/DataTable.
How adapter fills dataset in disconnected
architecture
and how dataset is used further…..
Data Table
DataTables
The DataTable class is a member of the System.Data namespace within the
.NET Framework class library.
A database table commonly has a column or group of columns that uniquely
identifies each row in the table. This identifying column or group of columns is
called the primary key.
Adding Primary Key For specific Table:
table1.PrimaryKey = New DataColumn()
table1.Columns(“RollNo")
DataTables
Syntax:
Imports system.data
Dim dt as DataTable = new DataTable()
dt.TableName = “Records”
’or use the DataTable(string TableName) constructor
Dim dt DataTable = new DataTable(“Records”)
DataTables
Adding A column to a Data Table:
dim dc as datacolumn = new datacolumn()
dc.columnName=“Names”
dc.datatype=GetType(String)
dc.defaultvalue=0
‘At the end
dt.column.add(dc)
 (Dt is the datatable variable defined previousely)
DataTables
Adding A row to a Data Table:
DataTables
Creating A complete Data Table:
' Create new DataTable instance.
Dim table As New DataTable
' Create three typed columns in the DataTable.
table.Columns.Add(“RollNo", GetType(Integer))
table.Columns.Add(“Name”, GetType(String))
table.Columns.Add(“Age", GetType(Integer))
' Add three rows with those columns filled in the DataTable.
table.Rows.Add(7756, “Ambreen Gillani", 20)
table.Rows.Add(7779, “Maira Abbas", 20)
table.Rows.Add(7764, "Hafiza Kawish Amin", 20)
Insert, Update Delete Command in
disconnected architecture
Guidelines….
 In disconnected architecture we work on dataset and that
dataset is filled by the data adapter.
 First the connection Is opened and all the data is copied
from data source to dataset by the adapter and then the
connection Is closed.
 Adapter.fill(ds) is used.
 Then we perform operations on that dataset and after
working, adapter.update command is required to update
the changes made to the datasource.
Insertion
Updating:
Deletion:
Display Records in Disconnected
Architecture
Display records using DataSet:
Searching In disconnected Architecture
 Searching For a specific Record :
Stored Procedure
Stored Procedures:
 A stored procedure is a precompiled executable object that
contains one or more SQL statements.
 Using stored procedures, database operations can be
encapsulated in a single command, optimized for best
performance, and enhanced with additional security.
 To call a stored procedure from VB.NET application, set the
CommandType of the Command object to Stored Procedure
and command text to that name you specified to Stored
Procedure.
Complete code for Insert & Delete record using
Stored Procedures….
Stored Procedure For Inserting & Deleting
Record:
Create And Drop Table Code:
Stored Procedures For Create and
drop:

More Related Content

What's hot

Ado.net
Ado.netAdo.net
Ado.net
dina1985vlr
 
Vb.net session 05
Vb.net session 05Vb.net session 05
Vb.net session 05Niit Care
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to adoHarman Bajwa
 
For Beginners - Ado.net
For Beginners - Ado.netFor Beginners - Ado.net
For Beginners - Ado.netTarun Jain
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentalsMadhuri Kavade
 
ADO.NET
ADO.NETADO.NET
ADO.NET
Wani Zahoor
 
ADO.NET -database connection
ADO.NET -database connectionADO.NET -database connection
ADO.NET -database connection
Anekwong Yoddumnern
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
iFour Institute - Sustainable Learning
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworks
Luis Goldster
 
Ado .net
Ado .netAdo .net
Ado .net
Manish Singh
 
Ado.net
Ado.netAdo.net
Ado.net
Vikas Trivedi
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
Randy Connolly
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
Randy Connolly
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
Sankhya_Analytics
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.net
Hemant Sankhla
 
Disconnected data
Disconnected dataDisconnected data
Disconnected dataaspnet123
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
Fernando G. Guerrero
 
ADO.NET difference faqs compiled- 1
ADO.NET difference  faqs compiled- 1ADO.NET difference  faqs compiled- 1
ADO.NET difference faqs compiled- 1
Umar Ali
 

What's hot (20)

Ado.net
Ado.netAdo.net
Ado.net
 
Vb.net session 05
Vb.net session 05Vb.net session 05
Vb.net session 05
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
For Beginners - Ado.net
For Beginners - Ado.netFor Beginners - Ado.net
For Beginners - Ado.net
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentals
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
ADO.NET -database connection
ADO.NET -database connectionADO.NET -database connection
ADO.NET -database connection
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworks
 
Ado .net
Ado .netAdo .net
Ado .net
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Ch 7 data binding
Ch 7 data bindingCh 7 data binding
Ch 7 data binding
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.net
 
Disconnected data
Disconnected dataDisconnected data
Disconnected data
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
ADO.NET difference faqs compiled- 1
ADO.NET difference  faqs compiled- 1ADO.NET difference  faqs compiled- 1
ADO.NET difference faqs compiled- 1
 

Viewers also liked

Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
salonityagi
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
Arun Prasad
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
Ranjuma Shubhangi
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Salim M
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computersimran153
 

Viewers also liked (7)

Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
 

Similar to Disconnected Architecture and Crystal report in VB.NET

Ado.net with asp.net
Ado.net with asp.netAdo.net with asp.net
Ado.net with asp.net
Sireesh K
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
Mahmoud Ouf
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net Architecture
Umar Farooq
 
Csharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxCsharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptx
facebookrecovery1
 
Ado.net session07
Ado.net session07Ado.net session07
Ado.net session07Niit Care
 
3. ADO.NET
3. ADO.NET3. ADO.NET
3. ADO.NET
Rohit Rao
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
Paneliya Prince
 
What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdf
Albert828253
 
Intake 37 10
Intake 37 10Intake 37 10
Intake 37 10
Mahmoud Ouf
 
Ado.Net
Ado.NetAdo.Net
Ado.Net
LiquidHub
 
Session 8 Bai 8 ve winform
Session 8 Bai 8 ve winformSession 8 Bai 8 ve winform
Session 8 Bai 8 ve winformmrtom16071980
 
QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7
Akash Tyagi
 
Marmagna desai
Marmagna desaiMarmagna desai
Marmagna desai
jmsthakur
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NET
DhruvVekariya3
 

Similar to Disconnected Architecture and Crystal report in VB.NET (20)

Ado.net with asp.net
Ado.net with asp.netAdo.net with asp.net
Ado.net with asp.net
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net Architecture
 
Csharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxCsharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptx
 
Ado.net session07
Ado.net session07Ado.net session07
Ado.net session07
 
ADO DOT NET
ADO DOT NETADO DOT NET
ADO DOT NET
 
3. ADO.NET
3. ADO.NET3. ADO.NET
3. ADO.NET
 
Unit4
Unit4Unit4
Unit4
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
 
Ado
AdoAdo
Ado
 
What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdf
 
Intake 37 10
Intake 37 10Intake 37 10
Intake 37 10
 
5.C#
5.C#5.C#
5.C#
 
Ado.Net
Ado.NetAdo.Net
Ado.Net
 
Module02
Module02Module02
Module02
 
Session 8 Bai 8 ve winform
Session 8 Bai 8 ve winformSession 8 Bai 8 ve winform
Session 8 Bai 8 ve winform
 
QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7
 
Marmagna desai
Marmagna desaiMarmagna desai
Marmagna desai
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NET
 

Recently uploaded

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 

Recently uploaded (20)

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 

Disconnected Architecture and Crystal report in VB.NET

  • 1. Disconnected Architecture in VB.NET By: Ambreen Gillani
  • 2. VB.NET Disconnected Architecture Data Sets, Data Tables, Data Adapters, Stored Procedures and managing their transections.
  • 4. ADO.NET  ADO.NET is part of the .NET framework technology that allows you to access and modify data from different data sources.  It supports many types of data sources such as Microsoft SQL Server, MySQL, Oracle, and Microsoft Access.  The .NET Framework provides a number of data providers that you can use. These data providers are used to connect to a data source, executes commands, and retrieve results.
  • 5. ADO.NET  ADO.NET was built for a disconnected architecture, so it enables truly disconnected data access and data manipulation through its Dataset Object, which is completely independent from the Data Source.  The two key components of ADO.NET are Data Providers and Data Set  ADO.net uses dataset object for disconnected architecture And data adapter fills it.
  • 7. DataSet  The DataSet is the central component in the ADO.NET Disconnected Data Access Architecture.  A DataSet is an in-memory data store that can hold multiple tables at the same time.  DataSets only hold data and do not interact with a Data Source.  One of the key characteristics of the DataSet is that it has no knowledge of the underlying Data Source that might have been used to populate it.  DataSet is disconnected architecture gets all records at once and closes connection and are available even after connection is closed  A DataSet is made up of a collection of tables, relationships, and constraints
  • 8. DataSet Syntax:  The Data Set is not connected directly to a Data Source through a Connection object when you populate it. It is the Data Adapter that manages connections between Data Source and Dataset by fill the data from Data Source to the Dataset and giving a disconnected behavior to the Dataset.  The Data Set contains Data Tables. The Data Tables contains Data Row and Data Columns. A Data Set or a Data Table can be used with a Command and a Data Adapter object to store query results.
  • 9. . Program Example for DataSet:
  • 11. Data Adapter  The Data Adapter acts as a bridge between the Disconnected Objects  Data Adapter is a part of the ADO.NET Data Provider.  Data Adapter provides the communication between the Dataset and the Data source.  We can use the DataAdapter in combination with the DataSet Object.  The Data Adapter can perform Select , Insert , Update and Delete SQL operations in the Data Source.  DataAdapter - A DataAdapter object is used to fill a DataSet/DataTable with query results.  Syntax: Dim adapter As New SqlDataAdapter adapter.SelectCommand = New SqlCommand(sql, sqlCnn) Dim ds As New DataSet adapter.Fill(ds)
  • 12. Data Adapter Adapter.Update(dataset_variable,”Table_Name”)  This command is used to update database after working on dataset.  This can be thought of as the adapter between the connected and disconnected data models.  A Command object will be used to execute the query and a DataAdapter will use this Command object and fill the query results coming from the database into a DataSet/DataTable.
  • 13. How adapter fills dataset in disconnected architecture and how dataset is used further…..
  • 15. DataTables The DataTable class is a member of the System.Data namespace within the .NET Framework class library. A database table commonly has a column or group of columns that uniquely identifies each row in the table. This identifying column or group of columns is called the primary key. Adding Primary Key For specific Table: table1.PrimaryKey = New DataColumn() table1.Columns(“RollNo")
  • 16. DataTables Syntax: Imports system.data Dim dt as DataTable = new DataTable() dt.TableName = “Records” ’or use the DataTable(string TableName) constructor Dim dt DataTable = new DataTable(“Records”)
  • 17. DataTables Adding A column to a Data Table: dim dc as datacolumn = new datacolumn() dc.columnName=“Names” dc.datatype=GetType(String) dc.defaultvalue=0 ‘At the end dt.column.add(dc)  (Dt is the datatable variable defined previousely)
  • 18. DataTables Adding A row to a Data Table:
  • 19. DataTables Creating A complete Data Table: ' Create new DataTable instance. Dim table As New DataTable ' Create three typed columns in the DataTable. table.Columns.Add(“RollNo", GetType(Integer)) table.Columns.Add(“Name”, GetType(String)) table.Columns.Add(“Age", GetType(Integer)) ' Add three rows with those columns filled in the DataTable. table.Rows.Add(7756, “Ambreen Gillani", 20) table.Rows.Add(7779, “Maira Abbas", 20) table.Rows.Add(7764, "Hafiza Kawish Amin", 20)
  • 20. Insert, Update Delete Command in disconnected architecture
  • 21. Guidelines….  In disconnected architecture we work on dataset and that dataset is filled by the data adapter.  First the connection Is opened and all the data is copied from data source to dataset by the adapter and then the connection Is closed.  Adapter.fill(ds) is used.  Then we perform operations on that dataset and after working, adapter.update command is required to update the changes made to the datasource.
  • 25. Display Records in Disconnected Architecture Display records using DataSet:
  • 26. Searching In disconnected Architecture  Searching For a specific Record :
  • 28. Stored Procedures:  A stored procedure is a precompiled executable object that contains one or more SQL statements.  Using stored procedures, database operations can be encapsulated in a single command, optimized for best performance, and enhanced with additional security.  To call a stored procedure from VB.NET application, set the CommandType of the Command object to Stored Procedure and command text to that name you specified to Stored Procedure.
  • 29. Complete code for Insert & Delete record using Stored Procedures….
  • 30. Stored Procedure For Inserting & Deleting Record:
  • 31. Create And Drop Table Code:
  • 32. Stored Procedures For Create and drop: