Download presentation
Presentation is loading. Please wait.
1
Lesson 10 Working with DATABASE
MIT Rapid Application Development By. S. Sabraz Nawaz SENIOR Lecturer in MIT FMC, SEUSL
2
The Data Cycle TableAdapterManager Data Source Configuration Wizard
Validation Datasets TableAdapters DataRow objects Data-bound controls By: S. Sabraz Nawaz, MIT 31043
3
Data Binding BindingSource: acts like a bridge between your data source (DataSet) and your data – bound controls By: S. Sabraz Nawaz, MIT 31043
4
Basic ADO.NET Components
ActiveX Data Objects .NET is the primary data access API for .NET framework Dataset .NET data provider Data Table Data Adapter Command Database Server Connection Data Table By: S. Sabraz Nawaz, MIT 31043
5
Connecting to a Database
By: S. Sabraz Nawaz, MIT 31043
6
Connecting to a Database…
By: S. Sabraz Nawaz, MIT 31043
7
Connecting to a Database…
By: S. Sabraz Nawaz, MIT 31043
8
Connecting to a Database…
By: S. Sabraz Nawaz, MIT 31043
9
Connecting to a Database…
By: S. Sabraz Nawaz, MIT 31043
10
Connecting to a Database…
By: S. Sabraz Nawaz, MIT 31043
11
Connecting to a Database…
By: S. Sabraz Nawaz, MIT 31043
12
Parameterized Queries - I
Finding a Record
13
Finding a Customer by a Field
We have established a connection to Northwind Sample Database We have a table call Customers By: S. Sabraz Nawaz, MIT 31043
14
Form is also designed like this
findCustomerTextbox searchButton By: S. Sabraz Nawaz, MIT 31043
15
Steps to create a paramterized query that locates a customer based on CustomerID field
Right click on customersTableAdapter Choose Add Query… By: S. Sabraz Nawaz, MIT 31043
16
A Dialog box appears like this
By: S. Sabraz Nawaz, MIT 31043
17
Add the following code By: S. Sabraz Nawaz, MIT 31043
18
Parameterized Queries - II
Filter Records – Single Condition
19
The form is designed like this
By: S. Sabraz Nawaz, MIT 31043
20
A New Parameterized Query is added with the Name FILLBY and its configuration looks like this
By: S. Sabraz Nawaz, MIT 31043
21
Double Click on filterCustomerIdTextBox text Box and add the following code in its TEXTCHANGED event
By: S. Sabraz Nawaz, MIT 31043
22
Parameterized Queries - III
Filter Records – Date Condition
23
Form with two text boxes for date Conditions
By: S. Sabraz Nawaz, MIT 31043
24
Connection to Northwind Database and Orders table
By: S. Sabraz Nawaz, MIT 31043
25
The Fill query is modified like this
By: S. Sabraz Nawaz, MIT 31043
26
The following code is added in showDetailsButton
The date value got from the textboxes are converted to proper date format using the Parse method of DateTime class By: S. Sabraz Nawaz, MIT 31043
27
At runtime By: S. Sabraz Nawaz, MIT 31043
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.