04 | Data Acess Technologies

Slides:



Advertisements
Similar presentations
17. Data Access ADO.Net Architecture New Features of ADO.NET
Advertisements

Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Introduction to Database Processing with ADO.NET.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 25.
1 ADO.NET. 2.NET Framework Data Namespaces System.Data –Base set of classes and interfaces for ADO.NET System.Data.Common –Classes shared by the.NET Data.
ADO. NET. What is “ADO.Net”? ADO.Net is a new object model for dealing with databases in.Net. Although some of the concepts are similar to the classical.
Programming in ADO.NET: Data-Centric Applications and ADO.NET Original copyright by Microsoft, 2002, with minor modifications by Dan Eaves, 2005.
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
XML files (with LINQ). Introduction to LINQ ( Language Integrated Query ) C#’s new LINQ capabilities allow you to write query expressions that retrieve.
Introducing LINQ to XML Florin−Tudor Cristea, Microsoft Student Partner.
C# programming with database Basic guideline. First step Install SQL Server 2008/2010 (Professional edition if possible) Install Visual Studio 2008/2010.
XML Fundementals XML vs.. HTML XML vs.. HTML XML Document (elements vs. attributes) XML Document (elements vs. attributes) XML and RDBMS XML and RDBMS.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Computer Science 317 Database Management Introduction to Web Access to Databases.
Chapter 9 Using the SqlDataSource Control. References aspx.
ADO.NET – part II August 2004 [ Marmagna Desai]. CONTENTS ADO vs ADO.NET ADO.NET – Managed providers Connecting to Database SqlConnection Selecting Database.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Presentation XML. NET SEMINAR By: Siddhant Ahuja (SID)
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Intro to C#.net and EF Ilan Shimshoni. The Three Faces of ADO.NET The connected layer – Directly connecting to the DB The disconnected layer – Using datasets.
Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.
LINQ TO XML Mike Taulty Developer & Platform Group Microsoft UK
.NET Data Access and Manipulation ADO.NET. Overview What is ADO.NET? Disconnected vs. connected data access models ADO.NET Architecture ADO.NET Core Objects.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
LINQ: It’s Not Your Father’s Data Access Denny Boynton Anheuser-Busch Companies.
The.NET Language Integrated Query Project Anders Hejlsberg TLN306 Technical Fellow Microsoft Corporation.
Moving from Microsoft ® ADO 2.X To ADO.NET Jackie Goldstein Renaissance Computer Systems Ltd. MSDN Regional Director, Israel Prerequisites.
 Language Integrated Query  Make query a part of the language  Component of.NET Framework 3.5  Shipped with Visual Studio 2008.
ASP.NET Rina Zviel-Girshin Lecture 5
Module 9: Accessing Relational Data Using Microsoft Visual Studio.NET.
Session 8: ADO.NET. Overview Overview of ADO.NET What is ADO.NET? Using Namespaces The ADO.NET Object Model What is a DataSet? Accessing Data with ADO.NET.
Module 7: Accessing Data by Using ADO.NET
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Introduction to ADO.NET ADO.NET - Lesson 01  Training time: 10 minutes  Author:
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
An Introduction to ADO.Net Marmagna Desai.NET Seminar, Fall-2003.
1 Data Classes- DataView DataGridView Control. Objectives 2  Data Class  DataAdapter  DataReader  DataSet  DataTable  DataView  DataGridView Control.
1.NET Language Integrated Query Yishai Zaltzberg.
Why ADO.NET Not your father’s Data Access.
Mauricio Featherman, Ph.D. Washington St. University
DEV383 The ADO.NET DataSet and You Jackie Goldstein General Manager Renaissance Computer Systems
Module 3: Working with Local Data. Overview Using DataSets Using XML Using SQL Server CE.
HNDIT Rapid Application Development
ADO.NET FUNDAMENTALS BEGINNING ASP.NET 3.5 IN C#.
Module 4 Introduction ADO.NET.
1 Database Programming with ADO.NET Kashef Mughal.
C# .NET Software Development
Active Data Objects Using.Net ADO.Net Farooq Ahmed Amna Umber Summayya Shehzad.
Module 5 Data Classes DataView – DataGridView Control 1.
DAT200 Microsoft® ADO.NET for ADO Classic Developers: Introducing ADO.NET Jackie Goldstein Renaissance Computer Systems
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
Data Access. ADO.NET ADO.NET is the primary library for building database solutions within the.NET Framework. ADO.NET does not replace ADO. ADO and OLEDB.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
.NET Data Access and Manipulation
Introduction to ADO.NET
Introduction to Database Processing with ADO.NET
Introduction to Database Processing with ADO.NET
ADO.NET Framework.
Lecture 6 VB.Net SQL Server.
XML in Web Technologies
An Introduction to Entity Framework
מתחברים למסד נתונים היכרות עם ADO.Net.
برنامه نویسی سیستم های شی گرا
Browser (Client Side) 瀏覽器 (客戶端)
Advances for Data in VS “Orcas”
Chapter 10 ADO.
Advances for Data in VS “Orcas”
PROG Advanced Web Apps 4/13/2019 Programming Data Pages Wendi Jollymore, ACES.
Visual Studio + SQL Server Is Better
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Introduction to Database Programming through ADO. NET
Presentation transcript:

04 | Data Acess Technologies Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist

Module Overview ADO.NET LINQ (Language Integrated Query) XML (Extensible Markup Language) LINQ to XML

ADO.NET

Basic ADO.NET Objects Connection* DataReader* Command* (SELECT, …) Results string constr = "Server=server;Database=db;User ID=user;Password=pwd;..."; using(SqlConnection connection = new SqlConnection(constr)) { string query = "SELECT TOP 10 PositionID, ReportedAt, Latitude, Longitude FROM dbo.Positions;"; using (SqlCommand cmd = new SqlCommand(query,connection)) { connection.Open(); using (SqlDataReader rdr = command.ExecuteReader()) while(rdr.Read()) string position = string.Format("{0},{1},{2},{3}",rdr.GetInt32(0),rdr.GetDateTime(1),rdr.GetFloat(2),rdr.GetFloat(3)); Console.WriteLine(position); } * ADO.NET Provider Specific: SqlConnection, SqlCommand, SqlDataReader

ADO.NET Providers

DataTable and DataAdapter Connection* DataTable DataAdapter* Fill() SelectCommand* Update() InsertCommand* UpdateCommand* DeleteCommand* * ADO.NET Provider Specific: SqlConnection, SqlCommand, SqlDataAdapter

DataSets Connection* DataSet DataAdapter(s)* Commands* Fill/Update * ADO.NET Provider Specific: SqlConnection, SqlCommand, SqlDataAdapter

Querying data with ADO.NET

LINQ (Language-INtegrated Query)

Data Sources & Client Access Relational DBs XML Collections ADO.NET / SQL DOM / XPath C#

LINQ to Objects & IEnumerable LINQ to the Rescue! Relational DBs XML Collections LINQ LINQ to Entities & IQueryable LINQ to XML LINQ to Objects & IEnumerable C#

What is LINQ? A way to query data in memory A collection of extension methods to IEnumerable Queries are “composable” and don’t execute until data is accessed. Allows querying, filtering, aggregating, joining, collections in memory A way to ship queries across application layers IQueryable represents the intention of the query Can be shipped between application tiers (service <> client) Service can provide the initial query Client can further “compose” the query (filter, sort, etc) Client passes the composed query back to the service The service returns the data as specified by the query. Cool!

LINQ to Objects

XML (Extensible Markup Language)

Good Old XML Read all about it: www.w3.org/xml (seriously) <Positions> <Position PositionID="1"> <ReportedAt>2008-11-10T22:51:00</ReportedAt> <Region>North Carolina</Region> <Country>United States</Country> <Latitude>35.06615067</Latitude> <Longitude>-76.96884918</Longitude> </Position> <Position PositionID="2"> <ReportedAt>2008-11-13T22:54:00</ReportedAt> <Latitude>35.06611633</Latitude> <Longitude>-76.96875000</Longitude> <Position PositionID="3"> <ReportedAt>2008-11-15T17:17:00</ReportedAt> <Latitude>35.06600189</Latitude> <!-- ... --> </Positions> Read all about it: www.w3.org/xml (seriously) Family of related standards XML XML Schemas XPath XQuery XSLT (Transformations) XSL-FO …

Working with XML in Code System.Xml XmlDocument for Document Object Model (DOM) based operations XmlReader for SAX (streaming) based operations Create XML with XmlDocument, XmlElement, XmlAttribute… Can save / load XML from files Can parse XML from strings

System.Xml Namespace XmlDocument XmlDeclaration XmlComment XmlElement <?xml version="1.0" ?> <!– Sample Position --> <Position>…</Position> <Position PositionID="1"> <Latitude> 35.06615067 </Latitude> <Longitude> -76.96884918 </Longitude> </Position> </Positions> XmlDocument XmlDeclaration XmlComment XmlElement XmlAttribute XmlText XmlNode

DOM Based XML Processing

LINQ to XML

LINQ to Objects & IEnumerable LINQ to the Rescue! Relational DBs XML Collections LINQ LINQ to Entities & IQueryable LINQ to XML LINQ to Objects & IEnumerable C#

System.Xml.Linq Namespace XDocument <?xml version="1.0" ?> <!– Sample Position --> <Position>…</Position> <Position PositionID="1"> <Latitude> 35.06615067 </Latitude> <Longitude> -76.96884918 </Longitude> </Position> </Positions> XDeclaration XComment XElement XAttribute XText

LINQ to XML