SlideShare una empresa de Scribd logo
1 de 68
Developing Windows and Web Applications using Visual Studio.NET Eric Phan Solution Architect
Homework? ,[object Object]
Credit Card Validation,[object Object]
Recap
1 2
Session 7: Data in the Web ,[object Object]
Old Style
New Style
DataBinding
DataGrid
Input Validation,[object Object]
Data
Bring database to the web Show/view Data Enter
OLD way
What is ADO.NET?  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
WebForm Apps WinForm Apps ADO.NET DataSets SQLConnection SQLCommand SQLDataAdapter SQLDataReader SQL Data Providers SQL Data XML Data Oracle Data …
Objects Instead of DataSets we use classes Extensible Can embed logic and validation A more OO approach
WebForm Apps WinForm Apps Objects/Entities Data Sources SQL Data XML Data Oracle Data …
DataSets or Business Objects Why use DataSets A highly functional container for data that can be strongly typed Automatic change tracking for contained data Seamless data-binding support Why Use Objects Business Objects (NHibernate, NTiers, LINQ to SQL, LINQ to Entities) Light weight Good data-binding support Extensible and OO Very easy to use No SQL command Strings
The new way!LINQ 2 EntitiesLINQ 2 SQL
LINQ to SQL/Entities Brand new in the .NET 3.5 Framework Easily access and query your database through classes Logical access to class hierarchies Supports Inheritance Intuitive to use
DBML File Database Mapping Language Contains a mapping of classes to database tables Has built in logic to handle selection, updates and deletes Can be customized www.hookedonlinq.com
var customers = 	from c in db.Customers 			where c.FirstName.StartsWith(“A”)		select c SQL Syntax
var  customers = db.Customers.Where(c => c.FirstName.StartsWith(“A”); Lambda Syntax
Challenge, use this instead of SQL Server Management Studio for a month LINQPad
See our Rules http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterLINQ.aspx
Databinding
Bind the data Data Data source
Data Binding Data Data source From MSDN: Data binding is the process that establishes connection between the application UI and business logic Binding controls to data from database Bind a grid on Webform to a database table Simple, convenient, and powerful way to create a read/write link between the controls on a form and the data in their application
Databinding the GridView (code) C# NorthwindDataContext db = newNorthwindDataContext(); GridView1.DataSource = db.Customers; GridView1.DataBind(); English  Instantiate our data access class Make the datasource of GridView1 all the customers from our database Bind the Grid
Databinding the GridView (designer)
Databinding the GridView (designer)
Databinding the GridView (designer)
Databinding the GridView (designer)
Databinding the GridView (designer)
Databinding the GridView (running)
GridView ,[object Object]
Display a Table from a Database
Easy to configure
Without writing any code at all,[object Object]
Enabling these features Enable Delete, Insert, Update on the DataSource
Enabling these features Enable them on the GridView
Easy!
Other Data Bindable Web Controls Bindable to Lists  DataList DetailsView FormView Repeater/ListView DropDownList ListBox CheckBoxList RadioButtonList Bindable to Properties/Columns Most other controls
Data-Bound Controls Most controls in .NET Framework support data binding Controls inherit from the WebControl base classwhich implements IDataBindingsAccessorinterface Important Data-binding properties  DataSource DataMember DisplayMember ValueMember Design your own controls or purchase 3rd party controls
Passing Parameters
Passing Parameters between pages Pass parameters to pages or controls Pass parameters to our data sources Parameters can be obtained from: Query String Session Variable Control Property Hidden Field Cookie
1. Create a CustomerDetails.aspx  Add a Details View and create a new Datasource
2. Create a LINQ Data Source
3. Specify the Where clause
4. Make it read from the Query String
5. Change the Select on the GridView to Link to the CustomerDetails Page
6. Edit the templates
7. Delete Select and Add a Hyperlink
8. Configure the Hyperlink CustomerDetails.aspx?CustomerID={0}
Run it
Validation – Don’t trust anyone
Validation - Bring database to the web Show/view Data Enter
Validation Why do we need it? PEBCAC Bad Data
Input Validation
Why use Validations? Seamless verification of data fields Check for mandatory fields Check for correct data formats Check for data ranges Reduces incorrect data entered into your database Prevent possible runtime exceptions
Validation Types Client Show/view Data Enter Client Server
Validation Types Client-Side Validation Validations are performed before the form is posted back Quick and responsive for the end user Insecure Server-Side Validation Validation checks are performed on the server Secure because these checks cannot be easily by passed Sometimes can be slow Recommendation Use both the types This approach provides the best of both worlds Client Show/view Data Enter Client Server
ASP.NET Validation Server Controls RequiredFieldValidator CompareValidator RangeValidator RegularExpressionValidator CustomValidator ValidationSummary
To put the Northwind database up on the web? CRUD for all tables Pages for all tables Validation	 So how long do you think it would take...
1 line of code 5 Minutes

Más contenido relacionado

La actualidad más candente

Design mission-critical enterprise applications with Power Automate and Docto...
Design mission-critical enterprise applications with Power Automate and Docto...Design mission-critical enterprise applications with Power Automate and Docto...
Design mission-critical enterprise applications with Power Automate and Docto...serge luca
 
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best PracticesMostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best PracticesSharePoint Saturday NY
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorialsTIB Academy
 
Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013
Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013 Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013
Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013 Scott Hoag
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchRob Windsor
 
SPS Belgium 2015 - High-trust Apps for On-Premises Development
SPS Belgium 2015 -  High-trust Apps for On-Premises DevelopmentSPS Belgium 2015 -  High-trust Apps for On-Premises Development
SPS Belgium 2015 - High-trust Apps for On-Premises DevelopmentEdin Kapic
 
Greg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service ApplicationsGreg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service ApplicationsSharePoint Saturday NY
 
The Who, What, Why and How of Active Directory Federation Services (AD FS)
The Who, What, Why and How of Active Directory Federation Services (AD FS)The Who, What, Why and How of Active Directory Federation Services (AD FS)
The Who, What, Why and How of Active Directory Federation Services (AD FS)Jay Simcox
 
Microsoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsMicrosoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsStudy Material
 
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...Vincent Biret
 
Integrate mule esb with microsoft office 365 share point
Integrate mule esb with microsoft office 365 share pointIntegrate mule esb with microsoft office 365 share point
Integrate mule esb with microsoft office 365 share pointsivachandra mandalapu
 
Microsoft Graph developer community call-March 2020
Microsoft Graph developer community call-March 2020Microsoft Graph developer community call-March 2020
Microsoft Graph developer community call-March 2020Microsoft 365 Developer
 
Whats New In Asp.Net Web Forms 4
Whats New In Asp.Net Web Forms 4Whats New In Asp.Net Web Forms 4
Whats New In Asp.Net Web Forms 4Rishu Mehra
 
Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...
Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...
Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...serge luca
 
An introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersAn introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersMicrosoft 365 Developer
 
Work experiences at Softcodeit
Work experiences at SoftcodeitWork experiences at Softcodeit
Work experiences at SoftcodeitVayodya Tamari
 
Using microsoft flow in real world projects 2 years later and what's next
Using microsoft flow in real world projects 2 years later and what's nextUsing microsoft flow in real world projects 2 years later and what's next
Using microsoft flow in real world projects 2 years later and what's nextserge luca
 

La actualidad más candente (20)

Design mission-critical enterprise applications with Power Automate and Docto...
Design mission-critical enterprise applications with Power Automate and Docto...Design mission-critical enterprise applications with Power Automate and Docto...
Design mission-critical enterprise applications with Power Automate and Docto...
 
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best PracticesMostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorials
 
Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013
Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013 Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013
Sydney SPUG - February 2014 - Pitfalls of Migrating to SharePoint 2013
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio Lightswitch
 
SPS Belgium 2015 - High-trust Apps for On-Premises Development
SPS Belgium 2015 -  High-trust Apps for On-Premises DevelopmentSPS Belgium 2015 -  High-trust Apps for On-Premises Development
SPS Belgium 2015 - High-trust Apps for On-Premises Development
 
Greg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service ApplicationsGreg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service Applications
 
The Who, What, Why and How of Active Directory Federation Services (AD FS)
The Who, What, Why and How of Active Directory Federation Services (AD FS)The Who, What, Why and How of Active Directory Federation Services (AD FS)
The Who, What, Why and How of Active Directory Federation Services (AD FS)
 
Microsoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsMicrosoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam Dumps
 
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
 
Mule microsoft
Mule  microsoftMule  microsoft
Mule microsoft
 
Integrate mule esb with microsoft office 365 share point
Integrate mule esb with microsoft office 365 share pointIntegrate mule esb with microsoft office 365 share point
Integrate mule esb with microsoft office 365 share point
 
Microsoft Graph developer community call-March 2020
Microsoft Graph developer community call-March 2020Microsoft Graph developer community call-March 2020
Microsoft Graph developer community call-March 2020
 
Whats New In Asp.Net Web Forms 4
Whats New In Asp.Net Web Forms 4Whats New In Asp.Net Web Forms 4
Whats New In Asp.Net Web Forms 4
 
Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...
Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...
Rencore Power Automate Mini Summit : Power Automate Business Process Manageme...
 
An introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersAn introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developers
 
mini_Project_SRS
mini_Project_SRSmini_Project_SRS
mini_Project_SRS
 
Work experiences at Softcodeit
Work experiences at SoftcodeitWork experiences at Softcodeit
Work experiences at Softcodeit
 
Using microsoft flow in real world projects 2 years later and what's next
Using microsoft flow in real world projects 2 years later and what's nextUsing microsoft flow in real world projects 2 years later and what's next
Using microsoft flow in real world projects 2 years later and what's next
 
SharePoint 2013 and ADFS
SharePoint 2013 and ADFSSharePoint 2013 and ADFS
SharePoint 2013 and ADFS
 

Destacado

ASP.NET 01 - Introduction
ASP.NET 01 - IntroductionASP.NET 01 - Introduction
ASP.NET 01 - IntroductionRandy Connolly
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NETPeter Gfader
 
N-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and SecurityN-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and SecurityPeter Gfader
 
Web Service
Web ServiceWeb Service
Web ServiceKumar S
 
Structured Process Of Developing A Web Application
Structured Process Of Developing A Web ApplicationStructured Process Of Developing A Web Application
Structured Process Of Developing A Web ApplicationKumar S
 
SQL Server - Introduction to TSQL
SQL Server - Introduction to TSQLSQL Server - Introduction to TSQL
SQL Server - Introduction to TSQLPeter Gfader
 

Destacado (7)

Asp.net new
Asp.net newAsp.net new
Asp.net new
 
ASP.NET 01 - Introduction
ASP.NET 01 - IntroductionASP.NET 01 - Introduction
ASP.NET 01 - Introduction
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
 
N-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and SecurityN-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and Security
 
Web Service
Web ServiceWeb Service
Web Service
 
Structured Process Of Developing A Web Application
Structured Process Of Developing A Web ApplicationStructured Process Of Developing A Web Application
Structured Process Of Developing A Web Application
 
SQL Server - Introduction to TSQL
SQL Server - Introduction to TSQLSQL Server - Introduction to TSQL
SQL Server - Introduction to TSQL
 

Similar a Work with data in ASP.NET

ASP.NET MVC Reading July 2009
ASP.NET MVC Reading July 2009ASP.NET MVC Reading July 2009
ASP.NET MVC Reading July 2009ukdpe
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Sparkhound Inc.
 
How to use Informatica Power Center as a RESTful Web Service Client?
How to use Informatica Power Center as a RESTful Web Service Client?How to use Informatica Power Center as a RESTful Web Service Client?
How to use Informatica Power Center as a RESTful Web Service Client?AmeliaWong21
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08Mani Chaubey
 
5. iED Cloud Services.pdf
5. iED Cloud Services.pdf5. iED Cloud Services.pdf
5. iED Cloud Services.pdfssuser905b17
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsJack-Junjie Cai
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08Vivek chan
 
Put Your Existing Application On Windows Azure
Put Your Existing Application On Windows AzurePut Your Existing Application On Windows Azure
Put Your Existing Application On Windows AzureMaarten Balliauw
 
Introduction To Sql Services
Introduction To Sql ServicesIntroduction To Sql Services
Introduction To Sql Servicesllangit
 
Connect Remotely Using Windows® 7 Direct Access
Connect Remotely Using Windows® 7 Direct AccessConnect Remotely Using Windows® 7 Direct Access
Connect Remotely Using Windows® 7 Direct AccessMicrosoft TechNet
 
Primavera integration possibilities Technical overview - Oracle Primavera Col...
Primavera integration possibilities Technical overview - Oracle Primavera Col...Primavera integration possibilities Technical overview - Oracle Primavera Col...
Primavera integration possibilities Technical overview - Oracle Primavera Col...p6academy
 
Access Apps for Office 365 with Power BI
Access Apps for Office 365 with Power BIAccess Apps for Office 365 with Power BI
Access Apps for Office 365 with Power BIChris McNulty
 
.NET RIA Services Architecture Overview
.NET RIA Services Architecture Overview .NET RIA Services Architecture Overview
.NET RIA Services Architecture Overview brada
 
Emergent architecture- a casestudy TREDS
Emergent architecture- a casestudy TREDSEmergent architecture- a casestudy TREDS
Emergent architecture- a casestudy TREDSSyed Rayhan
 
Real World API Design Using The Entity Framework Services
Real World API Design Using The Entity Framework ServicesReal World API Design Using The Entity Framework Services
Real World API Design Using The Entity Framework ServicesDavid McCarter
 

Similar a Work with data in ASP.NET (20)

ASP.NET MVC Reading July 2009
ASP.NET MVC Reading July 2009ASP.NET MVC Reading July 2009
ASP.NET MVC Reading July 2009
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
 
How to use Informatica Power Center as a RESTful Web Service Client?
How to use Informatica Power Center as a RESTful Web Service Client?How to use Informatica Power Center as a RESTful Web Service Client?
How to use Informatica Power Center as a RESTful Web Service Client?
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
5. iED Cloud Services.pdf
5. iED Cloud Services.pdf5. iED Cloud Services.pdf
5. iED Cloud Services.pdf
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applications
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
Put Your Existing Application On Windows Azure
Put Your Existing Application On Windows AzurePut Your Existing Application On Windows Azure
Put Your Existing Application On Windows Azure
 
B_110500002
B_110500002B_110500002
B_110500002
 
Introduction To Sql Services
Introduction To Sql ServicesIntroduction To Sql Services
Introduction To Sql Services
 
Connect Remotely Using Windows® 7 Direct Access
Connect Remotely Using Windows® 7 Direct AccessConnect Remotely Using Windows® 7 Direct Access
Connect Remotely Using Windows® 7 Direct Access
 
Primavera integration possibilities Technical overview - Oracle Primavera Col...
Primavera integration possibilities Technical overview - Oracle Primavera Col...Primavera integration possibilities Technical overview - Oracle Primavera Col...
Primavera integration possibilities Technical overview - Oracle Primavera Col...
 
Access Apps for Office 365 with Power BI
Access Apps for Office 365 with Power BIAccess Apps for Office 365 with Power BI
Access Apps for Office 365 with Power BI
 
.NET RIA Services Architecture Overview
.NET RIA Services Architecture Overview .NET RIA Services Architecture Overview
.NET RIA Services Architecture Overview
 
Emergent architecture- a casestudy TREDS
Emergent architecture- a casestudy TREDSEmergent architecture- a casestudy TREDS
Emergent architecture- a casestudy TREDS
 
Real World API Design Using The Entity Framework Services
Real World API Design Using The Entity Framework ServicesReal World API Design Using The Entity Framework Services
Real World API Design Using The Entity Framework Services
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
ASP.NET-stored procedure-manual
ASP.NET-stored procedure-manualASP.NET-stored procedure-manual
ASP.NET-stored procedure-manual
 

Más de Peter Gfader

Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity Peter Gfader
 
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019Peter Gfader
 
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)Peter Gfader
 
How to make more impact as an engineer
How to make more impact as an engineerHow to make more impact as an engineer
How to make more impact as an engineerPeter Gfader
 
13 explosive things you should try as an agilist
13 explosive things you should try as an agilist13 explosive things you should try as an agilist
13 explosive things you should try as an agilistPeter Gfader
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucksPeter Gfader
 
Use Scrum and Continuous Delivery to innovate like crazy!
Use Scrum and Continuous Delivery to innovate like crazy!Use Scrum and Continuous Delivery to innovate like crazy!
Use Scrum and Continuous Delivery to innovate like crazy!Peter Gfader
 
Innovation durch Scrum und Continuous Delivery
Innovation durch Scrum und Continuous DeliveryInnovation durch Scrum und Continuous Delivery
Innovation durch Scrum und Continuous DeliveryPeter Gfader
 
Qcon london2012 recap
Qcon london2012 recapQcon london2012 recap
Qcon london2012 recapPeter Gfader
 
Continuous Delivery with TFS msbuild msdeploy
Continuous Delivery with TFS msbuild msdeployContinuous Delivery with TFS msbuild msdeploy
Continuous Delivery with TFS msbuild msdeployPeter Gfader
 
Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Peter Gfader
 
Clean Code Development
Clean Code DevelopmentClean Code Development
Clean Code DevelopmentPeter Gfader
 
Data Mining with SQL Server 2008
Data Mining with SQL Server 2008Data Mining with SQL Server 2008
Data Mining with SQL Server 2008Peter Gfader
 
SSAS - Other Cube Browsers
SSAS - Other Cube BrowsersSSAS - Other Cube Browsers
SSAS - Other Cube BrowsersPeter Gfader
 
Reports with SQL Server Reporting Services
Reports with SQL Server Reporting ServicesReports with SQL Server Reporting Services
Reports with SQL Server Reporting ServicesPeter Gfader
 
OLAP – Creating Cubes with SQL Server Analysis Services
OLAP – Creating Cubes with SQL Server Analysis ServicesOLAP – Creating Cubes with SQL Server Analysis Services
OLAP – Creating Cubes with SQL Server Analysis ServicesPeter Gfader
 
Business Intelligence with SQL Server
Business Intelligence with SQL ServerBusiness Intelligence with SQL Server
Business Intelligence with SQL ServerPeter Gfader
 
SQL Server - Full text search
SQL Server - Full text searchSQL Server - Full text search
SQL Server - Full text searchPeter Gfader
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesPeter Gfader
 

Más de Peter Gfader (20)

Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity
 
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019
 
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
 
How to make more impact as an engineer
How to make more impact as an engineerHow to make more impact as an engineer
How to make more impact as an engineer
 
13 explosive things you should try as an agilist
13 explosive things you should try as an agilist13 explosive things you should try as an agilist
13 explosive things you should try as an agilist
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucks
 
Use Scrum and Continuous Delivery to innovate like crazy!
Use Scrum and Continuous Delivery to innovate like crazy!Use Scrum and Continuous Delivery to innovate like crazy!
Use Scrum and Continuous Delivery to innovate like crazy!
 
Innovation durch Scrum und Continuous Delivery
Innovation durch Scrum und Continuous DeliveryInnovation durch Scrum und Continuous Delivery
Innovation durch Scrum und Continuous Delivery
 
Speed = $$$
Speed = $$$Speed = $$$
Speed = $$$
 
Qcon london2012 recap
Qcon london2012 recapQcon london2012 recap
Qcon london2012 recap
 
Continuous Delivery with TFS msbuild msdeploy
Continuous Delivery with TFS msbuild msdeployContinuous Delivery with TFS msbuild msdeploy
Continuous Delivery with TFS msbuild msdeploy
 
Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...
 
Clean Code Development
Clean Code DevelopmentClean Code Development
Clean Code Development
 
Data Mining with SQL Server 2008
Data Mining with SQL Server 2008Data Mining with SQL Server 2008
Data Mining with SQL Server 2008
 
SSAS - Other Cube Browsers
SSAS - Other Cube BrowsersSSAS - Other Cube Browsers
SSAS - Other Cube Browsers
 
Reports with SQL Server Reporting Services
Reports with SQL Server Reporting ServicesReports with SQL Server Reporting Services
Reports with SQL Server Reporting Services
 
OLAP – Creating Cubes with SQL Server Analysis Services
OLAP – Creating Cubes with SQL Server Analysis ServicesOLAP – Creating Cubes with SQL Server Analysis Services
OLAP – Creating Cubes with SQL Server Analysis Services
 
Business Intelligence with SQL Server
Business Intelligence with SQL ServerBusiness Intelligence with SQL Server
Business Intelligence with SQL Server
 
SQL Server - Full text search
SQL Server - Full text searchSQL Server - Full text search
SQL Server - Full text search
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
 

Último

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Último (20)

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

Work with data in ASP.NET

  • 1. Developing Windows and Web Applications using Visual Studio.NET Eric Phan Solution Architect
  • 2.
  • 3.
  • 5. 1 2
  • 6.
  • 7.
  • 12.
  • 13. Data
  • 14. Bring database to the web Show/view Data Enter
  • 16. What is ADO.NET? 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
  • 17. WebForm Apps WinForm Apps ADO.NET DataSets SQLConnection SQLCommand SQLDataAdapter SQLDataReader SQL Data Providers SQL Data XML Data Oracle Data …
  • 18. Objects Instead of DataSets we use classes Extensible Can embed logic and validation A more OO approach
  • 19. WebForm Apps WinForm Apps Objects/Entities Data Sources SQL Data XML Data Oracle Data …
  • 20. DataSets or Business Objects Why use DataSets A highly functional container for data that can be strongly typed Automatic change tracking for contained data Seamless data-binding support Why Use Objects Business Objects (NHibernate, NTiers, LINQ to SQL, LINQ to Entities) Light weight Good data-binding support Extensible and OO Very easy to use No SQL command Strings
  • 21. The new way!LINQ 2 EntitiesLINQ 2 SQL
  • 22. LINQ to SQL/Entities Brand new in the .NET 3.5 Framework Easily access and query your database through classes Logical access to class hierarchies Supports Inheritance Intuitive to use
  • 23. DBML File Database Mapping Language Contains a mapping of classes to database tables Has built in logic to handle selection, updates and deletes Can be customized www.hookedonlinq.com
  • 24. var customers = from c in db.Customers where c.FirstName.StartsWith(“A”) select c SQL Syntax
  • 25. var customers = db.Customers.Where(c => c.FirstName.StartsWith(“A”); Lambda Syntax
  • 26. Challenge, use this instead of SQL Server Management Studio for a month LINQPad
  • 27.
  • 28. See our Rules http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterLINQ.aspx
  • 30. Bind the data Data Data source
  • 31. Data Binding Data Data source From MSDN: Data binding is the process that establishes connection between the application UI and business logic Binding controls to data from database Bind a grid on Webform to a database table Simple, convenient, and powerful way to create a read/write link between the controls on a form and the data in their application
  • 32. Databinding the GridView (code) C# NorthwindDataContext db = newNorthwindDataContext(); GridView1.DataSource = db.Customers; GridView1.DataBind(); English Instantiate our data access class Make the datasource of GridView1 all the customers from our database Bind the Grid
  • 39.
  • 40. Display a Table from a Database
  • 42.
  • 43. Enabling these features Enable Delete, Insert, Update on the DataSource
  • 44. Enabling these features Enable them on the GridView
  • 45. Easy!
  • 46. Other Data Bindable Web Controls Bindable to Lists DataList DetailsView FormView Repeater/ListView DropDownList ListBox CheckBoxList RadioButtonList Bindable to Properties/Columns Most other controls
  • 47. Data-Bound Controls Most controls in .NET Framework support data binding Controls inherit from the WebControl base classwhich implements IDataBindingsAccessorinterface Important Data-binding properties DataSource DataMember DisplayMember ValueMember Design your own controls or purchase 3rd party controls
  • 49. Passing Parameters between pages Pass parameters to pages or controls Pass parameters to our data sources Parameters can be obtained from: Query String Session Variable Control Property Hidden Field Cookie
  • 50. 1. Create a CustomerDetails.aspx Add a Details View and create a new Datasource
  • 51. 2. Create a LINQ Data Source
  • 52. 3. Specify the Where clause
  • 53. 4. Make it read from the Query String
  • 54. 5. Change the Select on the GridView to Link to the CustomerDetails Page
  • 55. 6. Edit the templates
  • 56. 7. Delete Select and Add a Hyperlink
  • 57. 8. Configure the Hyperlink CustomerDetails.aspx?CustomerID={0}
  • 59. Validation – Don’t trust anyone
  • 60. Validation - Bring database to the web Show/view Data Enter
  • 61. Validation Why do we need it? PEBCAC Bad Data
  • 63. Why use Validations? Seamless verification of data fields Check for mandatory fields Check for correct data formats Check for data ranges Reduces incorrect data entered into your database Prevent possible runtime exceptions
  • 64. Validation Types Client Show/view Data Enter Client Server
  • 65. Validation Types Client-Side Validation Validations are performed before the form is posted back Quick and responsive for the end user Insecure Server-Side Validation Validation checks are performed on the server Secure because these checks cannot be easily by passed Sometimes can be slow Recommendation Use both the types This approach provides the best of both worlds Client Show/view Data Enter Client Server
  • 66. ASP.NET Validation Server Controls RequiredFieldValidator CompareValidator RangeValidator RegularExpressionValidator CustomValidator ValidationSummary
  • 67. To put the Northwind database up on the web? CRUD for all tables Pages for all tables Validation So how long do you think it would take...
  • 68. 1 line of code 5 Minutes
  • 69. Awesome starting point Learn more from http://www.asp.net/dynamicdata/ ASP.NET Dynamic Data
  • 70. Extend what’s given to you and you can make really great websites You can use it as a framework
  • 71.
  • 72. Any issues ... questions PeterGfader@ssw.com.au EricPhan@ssw.com.au
  • 73. Thank You! Gateway Court Suite 10 81 - 91 Military Road Neutral Bay, Sydney NSW 2089 AUSTRALIA ABN: 21 069 371 900 Phone: + 61 2 9953 3000 Fax: + 61 2 9953 3105 info@ssw.com.auwww.ssw.com.au
  • 74. Resources www.hookedonlinq.com http://www.asp.net/get-started/ http://weblogs.asp.net/scottgu/ http://www.asp.net/dynamicdata/ If you have the next awesome web ideahttp://www.microsoft.com/BizSpark/ http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterLINQ.aspx

Notas del editor

  1. Click to add notesPeter Gfader Developing Windows and Web applications
  2. Request ResponseOpen browser and browse around
  3. Goal: Show View data to users on the webLet users enter and modify data
  4. Show how easy it isHow many code lines did i write?Show them the old wayHuge difference!
  5. Changes to Datasource get forwarded to databaseChanges from database get forwarded to data grid
  6. Property DataSource and DataMember on grid
  7. Show controls in VSDataList = More for List layout (http://msdn.microsoft.com/en-us/magazine/cc301328.aspx )DetailsView = mainly for editing (row/col switched) 1 record at a timeFormView = like detailsview but more control over html rendered code (layout) that’s goodListView = like datalist but more control again, see EA emp Repeater = same as Listview, Listview replaces repeaterDropDownListListBox = simple list of itemsCheckBoxListRadioButtonList
  8. Go to website: telerikTelerik RAD ControlsComponent ArtInfragisticsDevexpressJanus
  9. Suggest or common ones are querystring, hidden fieldCookies saving bits of info for all pagesE.g. Select a row from the grid and show the details in a DetailsViewPass the selected row’s ID (e.g. ContactID) as a query string parameterE.g. http://localhost:1234/MyWebApp/Details.aspx?ContactID=1
  10. Show url with IDPostback http://www.search-cube.com/
  11. Problem Exists Between Chair and ComputerClient database SWIFT project
  12. ASP.NET existing Validation controls create client side script for us
  13. CustomValidator Method Validate write your own code there (SERVER SIDE)