Enviar búsqueda
Cargar
Vb.net session 07
•
0 recomendaciones
•
527 vistas
Niit Care
Seguir
Tecnología
Denunciar
Compartir
Denunciar
Compartir
1 de 25
Recomendados
Apresentação12
Apresentação12
Marcosrael
Conceptos Basicos
Conceptos Basicos
Jorge Luis Sandoval
Presentación del sistema genesis y portal institucional j a
Presentación del sistema genesis y portal institucional j a
felipegomezg
Calidad de la salud en Colombia
Calidad de la salud en Colombia
gracianogx
Guía para tunear en limpio
Guía para tunear en limpio
Yolanda Gallardo Gómez
Cicatriz
Cicatriz
unasolacositabb
Efecto de la aplicación de Hormonas PGR en Plantas Ornamentales
Efecto de la aplicación de Hormonas PGR en Plantas Ornamentales
JOSE YVANOSKY VAZQUEZ CHACON
20120701saveMLAK_kusakari
20120701saveMLAK_kusakari
真 岡本
Recomendados
Apresentação12
Apresentação12
Marcosrael
Conceptos Basicos
Conceptos Basicos
Jorge Luis Sandoval
Presentación del sistema genesis y portal institucional j a
Presentación del sistema genesis y portal institucional j a
felipegomezg
Calidad de la salud en Colombia
Calidad de la salud en Colombia
gracianogx
Guía para tunear en limpio
Guía para tunear en limpio
Yolanda Gallardo Gómez
Cicatriz
Cicatriz
unasolacositabb
Efecto de la aplicación de Hormonas PGR en Plantas Ornamentales
Efecto de la aplicación de Hormonas PGR en Plantas Ornamentales
JOSE YVANOSKY VAZQUEZ CHACON
20120701saveMLAK_kusakari
20120701saveMLAK_kusakari
真 岡本
La tecnologia jesica arbelaez
La tecnologia jesica arbelaez
dayayyessi530
Ecologia
Ecologia
David Zuñiga
altiplano
altiplano
agnesfriantseigneurie
02
02
Carlos Tejada
Galileo iClinic e ADI 360, da oggi disponibili anche su Windows 8
Galileo iClinic e ADI 360, da oggi disponibili anche su Windows 8
Maria Beatrice Fasano
50 palabras y su significado
50 palabras y su significado
Iris Márquez
Origenes estadística
Origenes estadística
presentacionestmh2013
Beam engine
Beam engine
Kavinder singh
soal ujian kompetensi Tkj 2013
soal ujian kompetensi Tkj 2013
heri baskoro
Guia prático para quebra de dormência de sementes florestais de espécies nat...
Guia prático para quebra de dormência de sementes florestais de espécies nat...
Rural Pecuária
Daños causados porHormigas Cortadoras (Géneros Atta y Acromyrmex)
Daños causados porHormigas Cortadoras (Géneros Atta y Acromyrmex)
JOSE YVANOSKY VAZQUEZ CHACON
FOUR BAR CHAIN AND INVERSIONS
FOUR BAR CHAIN AND INVERSIONS
saahil kshatriya
Tecidos vegetais
Tecidos vegetais
turma21
Vb.net session 08
Vb.net session 08
Niit Care
Vb.net session 06
Vb.net session 06
Niit Care
Vb net xp_07
Vb net xp_07
Niit Care
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
ChristopherBow2
Day 8.1 system_admin_tasks
Day 8.1 system_admin_tasks
tovetrivel
Vb.net session 05
Vb.net session 05
Niit Care
Ado.net session01
Ado.net session01
Niit Care
06 asp.net session08
06 asp.net session08
Mani Chaubey
Crystal report
Crystal report
baabtra.com - No. 1 supplier of quality freshers
Más contenido relacionado
Destacado
La tecnologia jesica arbelaez
La tecnologia jesica arbelaez
dayayyessi530
Ecologia
Ecologia
David Zuñiga
altiplano
altiplano
agnesfriantseigneurie
02
02
Carlos Tejada
Galileo iClinic e ADI 360, da oggi disponibili anche su Windows 8
Galileo iClinic e ADI 360, da oggi disponibili anche su Windows 8
Maria Beatrice Fasano
50 palabras y su significado
50 palabras y su significado
Iris Márquez
Origenes estadística
Origenes estadística
presentacionestmh2013
Beam engine
Beam engine
Kavinder singh
soal ujian kompetensi Tkj 2013
soal ujian kompetensi Tkj 2013
heri baskoro
Guia prático para quebra de dormência de sementes florestais de espécies nat...
Guia prático para quebra de dormência de sementes florestais de espécies nat...
Rural Pecuária
Daños causados porHormigas Cortadoras (Géneros Atta y Acromyrmex)
Daños causados porHormigas Cortadoras (Géneros Atta y Acromyrmex)
JOSE YVANOSKY VAZQUEZ CHACON
FOUR BAR CHAIN AND INVERSIONS
FOUR BAR CHAIN AND INVERSIONS
saahil kshatriya
Tecidos vegetais
Tecidos vegetais
turma21
Destacado
(13)
La tecnologia jesica arbelaez
La tecnologia jesica arbelaez
Ecologia
Ecologia
altiplano
altiplano
02
02
Galileo iClinic e ADI 360, da oggi disponibili anche su Windows 8
Galileo iClinic e ADI 360, da oggi disponibili anche su Windows 8
50 palabras y su significado
50 palabras y su significado
Origenes estadística
Origenes estadística
Beam engine
Beam engine
soal ujian kompetensi Tkj 2013
soal ujian kompetensi Tkj 2013
Guia prático para quebra de dormência de sementes florestais de espécies nat...
Guia prático para quebra de dormência de sementes florestais de espécies nat...
Daños causados porHormigas Cortadoras (Géneros Atta y Acromyrmex)
Daños causados porHormigas Cortadoras (Géneros Atta y Acromyrmex)
FOUR BAR CHAIN AND INVERSIONS
FOUR BAR CHAIN AND INVERSIONS
Tecidos vegetais
Tecidos vegetais
Similar a Vb.net session 07
Vb.net session 08
Vb.net session 08
Niit Care
Vb.net session 06
Vb.net session 06
Niit Care
Vb net xp_07
Vb net xp_07
Niit Care
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
ChristopherBow2
Day 8.1 system_admin_tasks
Day 8.1 system_admin_tasks
tovetrivel
Vb.net session 05
Vb.net session 05
Niit Care
Ado.net session01
Ado.net session01
Niit Care
06 asp.net session08
06 asp.net session08
Mani Chaubey
Crystal report
Crystal report
baabtra.com - No. 1 supplier of quality freshers
Databind in asp.net
Databind in asp.net
Sireesh K
Work with data in ASP.NET
Work with data in ASP.NET
Peter Gfader
SCWCD : Web tier design CHAP : 11
SCWCD : Web tier design CHAP : 11
Ben Abdallah Helmi
IT 505 Final Submission Operating System Upgrade Implementation Brief
IT 505 Final Submission Operating System Upgrade Implementation Brief
EmmaDrinmk
Innovize it for_db2_empowering the dba_april_2016
Innovize it for_db2_empowering the dba_april_2016
Eliezer Harkavi
Oracle Certification 1Z0-1041 Questions and Answers
Oracle Certification 1Z0-1041 Questions and Answers
douglascarnicelli
Connect 2014 - CUST109 - planning and upgrading to ibm connections 4.5 succes...
Connect 2014 - CUST109 - planning and upgrading to ibm connections 4.5 succes...
Martin Schmidt
4 h0 002
4 h0 002
markuauyl
Sql portfolio admin_practicals
Sql portfolio admin_practicals
Shelli Ciaschini
Vb net xp_06
Vb net xp_06
Niit Care
Oracle data capture c dc
Oracle data capture c dc
Amit Sharma
Similar a Vb.net session 07
(20)
Vb.net session 08
Vb.net session 08
Vb.net session 06
Vb.net session 06
Vb net xp_07
Vb net xp_07
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Day 8.1 system_admin_tasks
Day 8.1 system_admin_tasks
Vb.net session 05
Vb.net session 05
Ado.net session01
Ado.net session01
06 asp.net session08
06 asp.net session08
Crystal report
Crystal report
Databind in asp.net
Databind in asp.net
Work with data in ASP.NET
Work with data in ASP.NET
SCWCD : Web tier design CHAP : 11
SCWCD : Web tier design CHAP : 11
IT 505 Final Submission Operating System Upgrade Implementation Brief
IT 505 Final Submission Operating System Upgrade Implementation Brief
Innovize it for_db2_empowering the dba_april_2016
Innovize it for_db2_empowering the dba_april_2016
Oracle Certification 1Z0-1041 Questions and Answers
Oracle Certification 1Z0-1041 Questions and Answers
Connect 2014 - CUST109 - planning and upgrading to ibm connections 4.5 succes...
Connect 2014 - CUST109 - planning and upgrading to ibm connections 4.5 succes...
4 h0 002
4 h0 002
Sql portfolio admin_practicals
Sql portfolio admin_practicals
Vb net xp_06
Vb net xp_06
Oracle data capture c dc
Oracle data capture c dc
Más de Niit Care
Ajs 1 b
Ajs 1 b
Niit Care
Ajs 4 b
Ajs 4 b
Niit Care
Ajs 4 a
Ajs 4 a
Niit Care
Ajs 4 c
Ajs 4 c
Niit Care
Ajs 3 b
Ajs 3 b
Niit Care
Ajs 3 a
Ajs 3 a
Niit Care
Ajs 3 c
Ajs 3 c
Niit Care
Ajs 2 b
Ajs 2 b
Niit Care
Ajs 2 a
Ajs 2 a
Niit Care
Ajs 2 c
Ajs 2 c
Niit Care
Ajs 1 a
Ajs 1 a
Niit Care
Ajs 1 c
Ajs 1 c
Niit Care
Dacj 4 2-c
Dacj 4 2-c
Niit Care
Dacj 4 2-b
Dacj 4 2-b
Niit Care
Dacj 4 2-a
Dacj 4 2-a
Niit Care
Dacj 4 1-c
Dacj 4 1-c
Niit Care
Dacj 4 1-b
Dacj 4 1-b
Niit Care
Dacj 4 1-a
Dacj 4 1-a
Niit Care
Dacj 1-2 b
Dacj 1-2 b
Niit Care
Dacj 1-3 c
Dacj 1-3 c
Niit Care
Más de Niit Care
(20)
Ajs 1 b
Ajs 1 b
Ajs 4 b
Ajs 4 b
Ajs 4 a
Ajs 4 a
Ajs 4 c
Ajs 4 c
Ajs 3 b
Ajs 3 b
Ajs 3 a
Ajs 3 a
Ajs 3 c
Ajs 3 c
Ajs 2 b
Ajs 2 b
Ajs 2 a
Ajs 2 a
Ajs 2 c
Ajs 2 c
Ajs 1 a
Ajs 1 a
Ajs 1 c
Ajs 1 c
Dacj 4 2-c
Dacj 4 2-c
Dacj 4 2-b
Dacj 4 2-b
Dacj 4 2-a
Dacj 4 2-a
Dacj 4 1-c
Dacj 4 1-c
Dacj 4 1-b
Dacj 4 1-b
Dacj 4 1-a
Dacj 4 1-a
Dacj 1-2 b
Dacj 1-2 b
Dacj 1-3 c
Dacj 1-3 c
Último
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
DianaGray10
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
Lonnie McRorey
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
LoriGlavin3
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
BookNet Canada
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
LoriGlavin3
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
Mattias Andersson
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Rizwan Syed
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
LoriGlavin3
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Curtis Poe
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
Raghuram Pandurangan
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Precisely
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Sergiu Bodiu
How to write a Business Continuity Plan
How to write a Business Continuity Plan
Databarracks
Último
(20)
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
How to write a Business Continuity Plan
How to write a Business Continuity Plan
Vb.net session 07
1.
Performing Data Updates Pre-Assessment
Questions 1. Consider the following statements: • Statement A: Complex data binding is the process of binding a control. • Statement B: Simple data binding is the process of binding a component. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 1 of 25
2.
Performing Data Updates Pre-Assessment
Questions (Contd.) 2. Consider the following statements: • Statement A: When user click the DataSource property of the DataGrid control, the drop-down list displays the <dataset.table name> option as well as the <dataset name> option. • Statement B: The CurrencyManager class is derived from the BindingManagerBase class. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 2 of 25
3.
Performing Data Updates Pre-Assessment
Questions (Contd.) 3. Consider the following statements: • Statement A: By using parameterized queries, data can be filtered based on the criterion entered by a user at run time. • Statement B: Parameterized queries cannot created while configuring data adapters. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 3 of 25
4.
Performing Data Updates Pre-Assessment
Questions (Contd.) 4. Consider the following statements: • Statement A: Data in a dataset can be filtered using the Select() method. • Statement B: Select method is a member of DataTable class. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 4 of 25
5.
Performing Data Updates Pre-Assessment
Questions (Contd.) 5. Consider the following statements: • Statement A: By default, every table in a dataset has a data view attached to it. • Statement B: User cannot create the DataView objects in applications explicitly. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 5 of 25
6.
Performing Data Updates Solutions
to Pre-Assessment Questions 2. a. Both, Statement A and Statement B, are False. 3. b. Both, Statement A and Statement B, are True. 4. c. Statement A is True and Statement B is False. 5. b. Both, Statement A and Statement B, are True. 6. c. Statement A is True and Statement B is False. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 6 of 25
7.
Performing Data Updates Objectives
In this lesson, you will learn to: • Implement cached data updates • Implement direct data updates • Maintain data concurrency • Display data from multiple tables in a single Windows Form ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 7 of 25
8.
Performing Data Updates Updating
Data • ADO.NET enables Windows Form to display data from the database. • Data can be retrieved from database using ADO.NET. • Database also can be updated with the changes user makes using ADO.NET. • Data can be retrieved from a database directly through data commands or cached in datasets. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 8 of 25
9.
Performing Data Updates Cached
Data Updates • The sequence of operations that occur during cached data update are: • Data from the database is cached in a dataset and presented to a user through an application. • The user updates the data, that is, adds, deletes, or modifies the data through the application. • The dataset is updated with the changes that the user makes through the application. • The changes in the dataset are transferred to the database at the back end. • Updating the database consists of two steps, updating the dataset and updating the database. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 9 of 25
10.
Performing Data Updates Updating
a Dataset • A dataset can be updated by using their collections, their objects, and their methods. • When user make changes to a record in the table, some events are raised by the DataTable object that are as follows: • ColumnChanging event • RowChanging event • ColumnChanged event • RowChanged event • RowDeleting event • RowDeleted event ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 10 of 25
11.
Performing Data Updates Using
Events to Validate the Data in a Dataset • The ColumnChanging and RowChanging events • The ColumnChanging event. • The RowChanging event. • The Row property. • Column property • The Row and Column properties • The data adapter needs information regarding each change in the dataset to update the data source. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 11 of 25
12.
Performing Data Updates Using
Events to Validate the Data in a Dataset (Contd.) • Dataset has to be maintain some information while making changes to dataset. This is as given below: • The RowState property • The DataRowVersion enumeration • Call the AcceptChanges() method of the dataset to accept the changes. • When the AcceptChanges() method is called, it overwrites the original version of a record with the current version. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 12 of 25
13.
Performing Data Updates Updating
a Data Source • The data source is updated with the changed dataset by calling the Update() method of the data adapter. • The data adapter uses the RowState property and the DataRowVersion enumeration information of the DataRow object to make the changes in the data source. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 13 of 25
14.
Performing Data Updates Direct
Data Updates • Data source also can be accessed directly through data. Data commands are generally used in the following cases: • To work with stored procedures that return a result set, which can be manipulated. • To access data that is not appropriate for storing in a dataset, such as data with a short life cycle. • To access read-only data, that is, data that will not be updated. • For executing a data command, the Connection, CommandText, and the Parameters properties for the data command have to be set. • Connection property is set for specifying the connection. • CommandText property is set for the SQL query or the stored procedure to be executed to retrieve the data. • Parameters property is set for the parameters for the execution of the command. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 14 of 25
15.
Performing Data Updates
Demo Maintaining Data ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 15 of 25
16.
Performing Data Updates Problem
Statement • The Diaz Telecommunications Sales Manager needs to view the customer details in a customized format. In addition, the customer details need to be maintained, which involves adding new customer details, and modifying and deleting the existing ones. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 16 of 25
17.
Performing Data Updates Solution
• To maintain customer details, you need to perform the following steps: 1. Design a Windows Form to update the data. 2. Connect to the database. 3. Bind the data to the Windows Forms Controls. 4. Write the code to update the data. 5. Perform data maintenance ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 17 of 25
18.
Performing Data Updates Maintaining
Data Concurrency • When many people attempt to modify data in a database at the same time, a system of controls must be implemented so that modifications made by one person do not adversely affect those of another person, this is called concurrency control. • There are three types of concurrency controls: • Pessimistic concurrency control • Optimistic concurrency control • ‘Last in Wins’ concurrency control • ADO.NET implements optimistic concurrency by using two methods Version Number Method and Saving All Values Method. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 18 of 25
19.
Performing Data Updates Optimistic
Concurrency through Data Adapters • To ensure that a data adapter, when configured, implements optimistic concurrency, perform the following steps: • Drag an OleDbDataAdapter object into the Windows Form. • Data Adapter Configuration Wizard starts. On the third screen of the wizard, ensure that the Use SQL statements option is selected. • On the fourth screen, click the Query Builder button to create a query for retrieving data. Select a table and its fields to be displayed. • After the table and its fields are selected, click the OK button. • Click the Advanced Options button. • The Use optimistic concurrency check box is selected by default. • Click the OK button. Then, click the Next button. The SQL statements for retrieving the data are generated. • Click the Finish button to create a data adapter. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 19 of 25
20.
Performing Data Updates Displaying
Data From Multiple Tables • Data can be displayed from two different tables, using relationship. To display data from two tables perform the following tasks: • Design a Windows Form to display data. • Connect to the database. • Generate a dataset for the created data adapters. • Create a relationship between the tables. • From the Solution Explorer window, select the XML schema for the dataset that has been created. • Double-click the schema dsMasterDetails.xsd to view its structure. The dataset structure is displayed. • Select View from the menu bar. Then, select Toolbox from the View menu. The Toolbox is displayed on the left pane of the screen. Select the XML Schema tab of the Toolbox. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 20 of 25
21.
Performing Data Updates Displaying
Data From Multiple Tables (Contd.) • Drag a Relation control from the XML Schema tab of the Toolbox to an table of the dataset. The Edit Relation dialog box is displayed. By default, the name of the relationship is <parent table name child table name>. • Set the Parent element, Child element, Key Fields, and Foreign Key Fields values in the Edit Relation dialog box and click the OK button. • A Relation icon appears between the two tables, depicting a relationship between them. You can modify the relationship by right-clicking the Relation icon and choosing the Edit Relation option from the shortcut menu. • Bind the data to the Windows Form controls. • Name the DataGrid control and bind it by setting the DataSource property and the DataMember property. • Bind the control on forms and write code to fill dataset on load event of form. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 21 of 25
22.
Performing Data Updates Using
Stored Procedures • Stored procedures are used for encapsulating database operations in a single command. • The ADO.NET Command object provides the Parameters collection for calling a stored procedure. • To call a stored procedure, you need to pass the stored procedure name followed by parameter arguments as an SQL statement. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 22 of 25
23.
Performing Data Updates Summary
In this lesson, you learned that: • ADO.NET enables you to display data from the database in a Windows Form. The sequence of operations that occur during cached data update is: • The dataset is updated with the changes that the user makes through the application. At this point, database remains unaffected, as the changes are made only in the dataset cache. • The user updates the data, that is, adds, deletes, or modifies the data through the application. • The dataset is updated with the changes that the user makes through the application. • The changes in the dataset are transferred to the database at the back end. • A dataset can be updated by using these collections, their objects, and their methods. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 23 of 25
24.
Performing Data Updates Summary
(Contd.) • The Rows collection of a DataSet class contains rows of data in a DataRow object. • The ColumnChanging and RowChanging events raised by the DataTable object are used to validate the values being entered in the dataset while updating the dataset. • The RowState property of the DataRow object indicates the current state of the record. • The data source is updated with the changed dataset by calling the Update() method of the data adapter. • Data commands can be used in the following cases: • To work with stored procedures that return a result set • To access data that is not appropriate for storing in a dataset ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 24 of 25
25.
Performing Data Updates Summary
(Contd.) • To access read-only data, that is, data that will not be updated. • The version number method requires the record to be updated to have a datetime stamp or a version number column. • By default, the data adapters that are created in an application implement optimistic concurrency. • Tables are stored in a dataset as discrete entities but a relationship can be created between the stored tables to display data from the related tables. • You can use stored procedures for encapsulating database operations in a single command. • The ADO.NET Command object provides the Parameters collection for calling a stored procedure. ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2A / Slide 25 of 25