Lesson 10 Working with DATABASE MIT 31043 Rapid Application Development By. S. Sabraz Nawaz SENIOR Lecturer in MIT FMC, SEUSL
The Data Cycle TableAdapterManager Data Source Configuration Wizard Validation Datasets TableAdapters DataRow objects Data-bound controls By: S. Sabraz Nawaz, MIT 31043
Data Binding BindingSource: acts like a bridge between your data source (DataSet) and your data – bound controls By: S. Sabraz Nawaz, MIT 31043
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
Connecting to a Database By: S. Sabraz Nawaz, MIT 31043
Connecting to a Database… By: S. Sabraz Nawaz, MIT 31043
Connecting to a Database… By: S. Sabraz Nawaz, MIT 31043
Connecting to a Database… By: S. Sabraz Nawaz, MIT 31043
Connecting to a Database… By: S. Sabraz Nawaz, MIT 31043
Connecting to a Database… By: S. Sabraz Nawaz, MIT 31043
Connecting to a Database… By: S. Sabraz Nawaz, MIT 31043
Parameterized Queries - I Finding a Record
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
Form is also designed like this findCustomerTextbox searchButton By: S. Sabraz Nawaz, MIT 31043
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
A Dialog box appears like this By: S. Sabraz Nawaz, MIT 31043
Add the following code By: S. Sabraz Nawaz, MIT 31043
Parameterized Queries - II Filter Records – Single Condition
The form is designed like this By: S. Sabraz Nawaz, MIT 31043
A New Parameterized Query is added with the Name FILLBY and its configuration looks like this By: S. Sabraz Nawaz, MIT 31043
Double Click on filterCustomerIdTextBox text Box and add the following code in its TEXTCHANGED event By: S. Sabraz Nawaz, MIT 31043
Parameterized Queries - III Filter Records – Date Condition
Form with two text boxes for date Conditions By: S. Sabraz Nawaz, MIT 31043
Connection to Northwind Database and Orders table By: S. Sabraz Nawaz, MIT 31043
The Fill query is modified like this By: S. Sabraz Nawaz, MIT 31043
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
At runtime By: S. Sabraz Nawaz, MIT 31043