SlideShare a Scribd company logo
Pemrograman Komputer Pertemuan 10 Database (cont) Bambang Heru Iswanto, Dr.rer.nat M.Si Jurusan Fisika Fakultas Matematika dan Ilmu Pengetahuan Alam 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Creating a Dataset Dataset: a copy of the data that is retrieved from the database and then inserted into memory To create a dataset: Select the OleDbAdapter control Right-click on the control and select Generate dataset Generate dataset dialog box opens 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Binding Data to Controls Data binding: the process of connecting a control to one or more data elements A data-aware control is capable of automatically displaying data from a field(s) in a dataset Simple binding connects one control to one data element Complex binding is used when more than one data element is bound to a control 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Filling the Dataset The data adapter’s Fill method Used to fill the dataset at run-time   DataAdaptername.Fill(DataSetName) 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Navigating through the Dataset BindingContext object manages all of the data bindings for the controls on the form CurrencyManager object provides a simple way to navigate among the rows in a dataset 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Updating a Dataset Changes to data in the dataset do not affect the database unless an explicit operation is executed Via the data adapter, you can make the changes in the dataset and then write the changes back to the data source Initialization code 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Updating a Dataset Adding a record Create an empty row that has the same fields as in the table to be modified Enter data into the fields of the new row Add the new row to the table in the dataset Save the updated table back to the data source 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Updating a Datase Delete a record RemoveAt method Ensure that the user really wants to proceed with the deletion Update method Editing a record Update method Many safeguards are needed 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Creating Datasets Using SQL Structured query: a statement written according to the rules of a language called Structured Query Language (SQL), that uniquely identifies a set of records from one or more tables Basic syntax of an SQL SELECT command (or a structured query) SELECT field(s) FROM table(s) [WHERE condition(s)] [ORDER BY field(s)] 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Creating Datasets Using SQL SELECT clause specifies the field values that will be returned by the query SELECT * specifies that all fields are to be obtained FROM clause specifies the table or tables where records will be searched WHERE clause is used to place any restrictions on the data to be selected ORDER BY clause is used if the selected information is to be presented in a specified order 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
DataGrid Control Used to display and modify one or more database tables To create a DataGrid on a form Click on the DataGrid control in the toolbox and then draw it on the Form, or Double-click on the tool and resize it on the Form To associate a DataGrid control with a table in an existing dataset Set the DataSource property to the name of the table 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
DataGrid Control DataGrid Control Initially placed on a Form 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
Common Programming Errors and Problems Not saving the last edit performed on a dataset Forgetting that changes to the dataset are not automatically reflected in the data source Forgetting to put quotes around the string in a WHERE clause of an SQL statement that is equal to a field Forgetting that the Position property starts at zero and that the first record in a dataset is at position zero, not one 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |
TERIMA KASIH 01/02/11 ©  2010 Universitas Negeri Jakarta  |  www.unj.ac.id  |

More Related Content

DOC
Challenges of cost and security when transitioning to electronic health records
PDF
PDF
499326 ds
PDF
1 n3305 -1n3350_(50_watt)
PDF
PDF
Data Sheet Microcontrolador 501916 ds
PDF
8279
PDF
1N100 - Ingenieriaelectronica.org
Challenges of cost and security when transitioning to electronic health records
499326 ds
1 n3305 -1n3350_(50_watt)
Data Sheet Microcontrolador 501916 ds
8279
1N100 - Ingenieriaelectronica.org

What's hot (9)

PDF
Removing the information bottleneck in R&D
PPT
Queries
PPT
Throw the Semantic Web at Today's Health-care
PDF
Real Time Web-based Data Monitoring and Manipulation System to Improve Transl...
PDF
Fusion method used to tolerate the faults occurred in disrtibuted system
PDF
Possibilities for integrating model-related data in computational biology (DI...
DOCX
Abstract.DOCX
PPTX
Charleston Conference 2016
PPTX
Record matching over query results from Web Databases
Removing the information bottleneck in R&D
Queries
Throw the Semantic Web at Today's Health-care
Real Time Web-based Data Monitoring and Manipulation System to Improve Transl...
Fusion method used to tolerate the faults occurred in disrtibuted system
Possibilities for integrating model-related data in computational biology (DI...
Abstract.DOCX
Charleston Conference 2016
Record matching over query results from Web Databases
Ad

Viewers also liked (14)

PDF
Part 3 4 - dbms pada sql server 2005 express
PPT
Konsep basis data pengantar my sql
PPTX
[GEOGRAFI XII IIS 1] Sistem Informasi Geografis/SIG - MAN 2 KOTA SERANG
PPT
Pengantar SQL
PPT
Materi diagram kelas-implementasi-1
PPT
Sistem Informasi Geografi
PPTX
Erd dan contoh kasus
PPT
Bab 7 studi kasus
DOCX
Entity Relationship Diagram
PPTX
Erd dan contoh kasus
PPTX
Software Engineering- ERD DFD Decision Tree and Table
PPTX
Fungsi komposisi dan fungsi invers
PPT
Sistem informasi geografi
PPTX
Pekan 2 data, informasi, dan basisdata
Part 3 4 - dbms pada sql server 2005 express
Konsep basis data pengantar my sql
[GEOGRAFI XII IIS 1] Sistem Informasi Geografis/SIG - MAN 2 KOTA SERANG
Pengantar SQL
Materi diagram kelas-implementasi-1
Sistem Informasi Geografi
Erd dan contoh kasus
Bab 7 studi kasus
Entity Relationship Diagram
Erd dan contoh kasus
Software Engineering- ERD DFD Decision Tree and Table
Fungsi komposisi dan fungsi invers
Sistem informasi geografi
Pekan 2 data, informasi, dan basisdata
Ad

Similar to Pemrograman komputer 10 (database) (20)

PPT
Pemrograman komputer 9 (database)
PPT
New Features Sql 2008
PDF
Oracle data capture c dc
PPT
Week 2 Characteristics & Benefits of a Database & Types of Data Models
PPT
Windows Mobile 5.0 Data Access And Storage Webcast
PDF
Optimize access
PPT
ADO .Net
PDF
Open Data Convergence
PPTX
2nd chapter dbms.pptx
PPT
Teradata Unity
PPTX
Ado.net
PDF
Ado.Net Architecture
DOCX
MIS201 Database Fundamentals.docx
PPT
Three tier Architecture of ASP_Net
PPT
Mule database connector
PDF
Business Analytics 1 Module 2.pdf
PPT
the .NET Framework. It provides the claf
Pemrograman komputer 9 (database)
New Features Sql 2008
Oracle data capture c dc
Week 2 Characteristics & Benefits of a Database & Types of Data Models
Windows Mobile 5.0 Data Access And Storage Webcast
Optimize access
ADO .Net
Open Data Convergence
2nd chapter dbms.pptx
Teradata Unity
Ado.net
Ado.Net Architecture
MIS201 Database Fundamentals.docx
Three tier Architecture of ASP_Net
Mule database connector
Business Analytics 1 Module 2.pdf
the .NET Framework. It provides the claf

More from jayamartha (20)

DOC
Kalkulus 1 - Kuis 4
DOC
Kalkulus 1 - Kuis 3
DOC
Kalkulus 1 - Kuis 2
DOC
Kalkulus 1 - Kuis 1
PPTX
PPT
Week 15 kognitif
PPT
15-superconductivity
PPT
12-14 d-effect_of_electron_-_electron_interaction
PPT
7-metal_vs_semiconductor
PPT
12 -14 c-spin_paramagnetism
PPT
12 -14 b-diamagnetism
PPT
12-14 a-magnetic_effects_in_quantum _mechanics
PPT
Week4-5 tb-kognitif
PPT
10-11 a-energy_bands
PPT
7 -metal_vs_semiconductor
PPT
Week-13 model pembelajaran
PPT
5-6-definition_of_semiconductor
PPT
Week-15 kognitif
PPT
Week 15 kognitif
PPT
Pert 1-4
Kalkulus 1 - Kuis 4
Kalkulus 1 - Kuis 3
Kalkulus 1 - Kuis 2
Kalkulus 1 - Kuis 1
Week 15 kognitif
15-superconductivity
12-14 d-effect_of_electron_-_electron_interaction
7-metal_vs_semiconductor
12 -14 c-spin_paramagnetism
12 -14 b-diamagnetism
12-14 a-magnetic_effects_in_quantum _mechanics
Week4-5 tb-kognitif
10-11 a-energy_bands
7 -metal_vs_semiconductor
Week-13 model pembelajaran
5-6-definition_of_semiconductor
Week-15 kognitif
Week 15 kognitif
Pert 1-4

Recently uploaded (20)

PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Classroom Observation Tools for Teachers
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Institutional Correction lecture only . . .
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
master seminar digital applications in india
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
GDM (1) (1).pptx small presentation for students
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Classroom Observation Tools for Teachers
O7-L3 Supply Chain Operations - ICLT Program
01-Introduction-to-Information-Management.pdf
A systematic review of self-coping strategies used by university students to ...
STATICS OF THE RIGID BODIES Hibbelers.pdf
RMMM.pdf make it easy to upload and study
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Institutional Correction lecture only . . .
Supply Chain Operations Speaking Notes -ICLT Program
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Microbial diseases, their pathogenesis and prophylaxis
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Microbial disease of the cardiovascular and lymphatic systems
master seminar digital applications in india
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape

Pemrograman komputer 10 (database)

  • 1. Pemrograman Komputer Pertemuan 10 Database (cont) Bambang Heru Iswanto, Dr.rer.nat M.Si Jurusan Fisika Fakultas Matematika dan Ilmu Pengetahuan Alam 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 2. Creating a Dataset Dataset: a copy of the data that is retrieved from the database and then inserted into memory To create a dataset: Select the OleDbAdapter control Right-click on the control and select Generate dataset Generate dataset dialog box opens 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 3. Binding Data to Controls Data binding: the process of connecting a control to one or more data elements A data-aware control is capable of automatically displaying data from a field(s) in a dataset Simple binding connects one control to one data element Complex binding is used when more than one data element is bound to a control 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 4. Filling the Dataset The data adapter’s Fill method Used to fill the dataset at run-time DataAdaptername.Fill(DataSetName) 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 5. Navigating through the Dataset BindingContext object manages all of the data bindings for the controls on the form CurrencyManager object provides a simple way to navigate among the rows in a dataset 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 6. Updating a Dataset Changes to data in the dataset do not affect the database unless an explicit operation is executed Via the data adapter, you can make the changes in the dataset and then write the changes back to the data source Initialization code 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 7. Updating a Dataset Adding a record Create an empty row that has the same fields as in the table to be modified Enter data into the fields of the new row Add the new row to the table in the dataset Save the updated table back to the data source 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 8. Updating a Datase Delete a record RemoveAt method Ensure that the user really wants to proceed with the deletion Update method Editing a record Update method Many safeguards are needed 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 9. Creating Datasets Using SQL Structured query: a statement written according to the rules of a language called Structured Query Language (SQL), that uniquely identifies a set of records from one or more tables Basic syntax of an SQL SELECT command (or a structured query) SELECT field(s) FROM table(s) [WHERE condition(s)] [ORDER BY field(s)] 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 10. Creating Datasets Using SQL SELECT clause specifies the field values that will be returned by the query SELECT * specifies that all fields are to be obtained FROM clause specifies the table or tables where records will be searched WHERE clause is used to place any restrictions on the data to be selected ORDER BY clause is used if the selected information is to be presented in a specified order 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 11. DataGrid Control Used to display and modify one or more database tables To create a DataGrid on a form Click on the DataGrid control in the toolbox and then draw it on the Form, or Double-click on the tool and resize it on the Form To associate a DataGrid control with a table in an existing dataset Set the DataSource property to the name of the table 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 12. DataGrid Control DataGrid Control Initially placed on a Form 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 13. Common Programming Errors and Problems Not saving the last edit performed on a dataset Forgetting that changes to the dataset are not automatically reflected in the data source Forgetting to put quotes around the string in a WHERE clause of an SQL statement that is equal to a field Forgetting that the Position property starts at zero and that the first record in a dataset is at position zero, not one 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |
  • 14. TERIMA KASIH 01/02/11 © 2010 Universitas Negeri Jakarta | www.unj.ac.id |