Title: Developing Windows and Web Applications using Visual Studio'NET
1Developing Windows and Web Applications using
Visual Studio.NET
2Admin Stuff
- Attendance
- You initial sheet
- Hands On Lab
- You get me to initial sheet
- Homework
- Certificate
- At end of 10 sessions
- If I say if you have completed successfully ?
3Session 1 Overview
- Agenda
- What is ADO.NET?
- Whats New in ADO.NET 2005?
- DataBinding
- GridView
- Input Validation
4The 10 Sessions
- http//www.ssw.com.au/ssw/events/2005UTSNET/defaul
t.aspx
5What is ADO.NET?
- What is ADO.NET, anyway?
- ADO.NET is a set of classes that expose data
access services to the .NET programmer. - ADO.NET provides a rich set of components for
creating distributed, data-sharing applications. - It is an integral part of the .NET Framework,
providing access to relational data, XML, and
application data.
6Advantages of ADO.NET
- ADO.NET vs. ADO
- Typed Data Sets
- Why are they better?
Good example typed dataset
Dim OrdersList As New OrdersDataSet txtProductID.T
ext OrdersList.Order_Details(0).ProductID txtPro
ductName.Text OrdersList.Order_Details(0).Produc
tName
Bad example untyped dataset
Dim OrdersList As New OrdersDataSet txtProductID.T
ext OrdersList.Order_Details(0).Item("ProductID"
) txtProductName.Text OrdersList.Order_Details(0
).Item("ProductName")
7ADO.NET 101
8DataBinding
- What is Data Binding?Data Binding is binding
controls to data from databases. - With data binding we can bind a control to a
particular column in a table from the database or
we can bind the whole table to a DataGrid (or a
GridView). - Data binding provides simple, convenient, and
powerful way to create a read/write link between
the controls on a form and the data in their
application.
9DataBinding GridView Demo
Basics of DataBinding
- C
- DataSet ds new DataSet()
- ds YourMethod()
- GridView1.DataSource ds
- GridView1.DataBind()
EnglishCreate a new datasetLink your DataSet
to a Method that returns a DataSet Specify the
data source of the GridViewBind the data to the
GridView.
10GridView
- The GridView control allows you to select, sort,
and edit these items. - The GridView provides a quick way to display a
Table from a Database. - GirdViews are very easy to configure.
- A GridView can be used without writing any code
at all even with your own business objects.
11Input Validation in ASP.NET
- In the olden days you used JavaScript
- Hard to debug and maintain
- Tedious have to write code for every field
- Not compatible across all browsers
- function IsEmpty(aTextField)
- if ((aTextField.value.length0)
(aTextField.valuenull)) - aTextField.focus()
- return true
-
- else return false
-
- // Call this for each control
- You can use DHTML etc. but it is not
cross-browser compatible
12Input Validation in ASP.NET
- Enter ASP.NET Input Validation
- Very easy to use
- No server round-trip
- Little or no code all done in the designer
- Supported in all browsers
- Powerful validation with regex validator
13Summary
- What is ADO.NET?
- Whats New in ADO.NET 2005?
- DataBinding
- GridView
- Super-powerful Input Validation
142 things
EricPhan_at_ssw.com.au JatinValabjee_at_ssw.com.au