Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Programming ADO.NET in Whidbey Pablo Castro/Brad Rhodes ADO.NET Team Microsoft Corporation Pablo Castro/Brad Rhodes.

Similar presentations


Presentation on theme: "1 Programming ADO.NET in Whidbey Pablo Castro/Brad Rhodes ADO.NET Team Microsoft Corporation Pablo Castro/Brad Rhodes."— Presentation transcript:

1 1 Programming ADO.NET in Whidbey Pablo Castro/Brad Rhodes ADO.NET Team Microsoft Corporation [pablocas|bradrhod]@microsoft.com Pablo Castro/Brad Rhodes ADO.NET Team Microsoft Corporation [pablocas|bradrhod]@microsoft.com Session Code: ARC403

2 2 Tools Client Application Model AvalonWindows Forms Web & Service Application Model ASP.NET / Indigo Win FS Compact Framework Yukon Mobile PC Optimized System.Help System.Drawing System.NaturalLanguageServices Data Systems Application Model Presentation Data Mobile PC & Devices Application Model Communication Command Line NT Service DataSet Mapping ObjectSpaces ObjectSpace Query Schema Item Relationship Media Audio Video Images System.Messaging System. Discovery System.DirectoryServices System.Remoting System.Runtime.Remoting Active Directory Uddi System.Web.Services Web.Service Description Discovery Protocols System.MessageBus Transport Port Channel Service Queue PubSub Router System.Timers System.Globalization System.Serialization System.Threading System.Text System.Design Base & Application Services Fundamentals System.ComponentModel System.CodeDom System.Reflection System.EnterpriseServices System.Transactions Security System.Windows. TrustManagement System.Web. Security System.Message Bus.Security Authorization AccessControl Credentials Cryptography System.Web.Configuration System.MessageBus.Configuration System.Configuration System.Resources System.Management System.Deployment System.Diagnostics ConfigurationDeployment/Management System.Windows System.Windows.Forms System.Console System.ServiceProcess System.Windows.Forms System.Web System.Storage System.Data.SqlServer Animation Controls Control Design Panel Controls Dialogs SideBar Notification System.Windows Documents Text Element Shapes Shape Ink UI Element Explorer Media System.Windows.Forms Forms Control Print Dialog Design System.Web.UI Page Control HtmlControls MobileControls WebControls Adaptors Design Ports InteropServices System.Runtime System.IO System.Collections Generic System.Search Annotations Monitoring Logging Relevance System.Data SqlClient SqlTypes SqlXML OdbcClient OleDbClient OracleClient Core Contact Location Message Document Event System.Storage System.Web Personalization Caching SessionState System.Xml Schema Serialization Xpath Query Permissions Policy Principal Token System.Security System.Collaboration RealTimeEndpoint TransientDataSession SignalingSession Media Activities HttpWebRequest FtpWebListener SslClientStream WebClient System.Net NetworkInformation Sockets Cache System.Web Administration Management Navigation Peer Group Policy Serialization CompilerServices Recognition System.Speech Synthesis

3 3 Agenda Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes

4 4 ADO.NET Whidbey Themes Strictly incremental No revolutions Address customer requests Lots of new customer-driven features More power for power users Performance, Performance, Performance First-class support for SQL Server “Yukon” Strictly incremental No revolutions Address customer requests Lots of new customer-driven features More power for power users Performance, Performance, Performance First-class support for SQL Server “Yukon” No Model Changes. If it works now, will work in Whidbey :)

5 5 Agenda Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes

6 6 Asynchronous Data Access Great for: Client apps: avoid blocking the UI Server apps: avoid blocking threads Consistent with the.NET async pattern BeginOpen, EndOpen, BeginExecute, … API available for 3 rd party providers We ship async support in SqlClient Works with SQL Server 7, 2000, “Yukon” True asynchronous data access Great for: Client apps: avoid blocking the UI Server apps: avoid blocking threads Consistent with the.NET async pattern BeginOpen, EndOpen, BeginExecute, … API available for 3 rd party providers We ship async support in SqlClient Works with SQL Server 7, 2000, “Yukon” True asynchronous data access

7 7 Waiting for the DB (not)

8 8 Batch Updates Currently DataAdapter.Update does a round-trip per row New support for batching in Whidbey adapter.UpdateBatchSize = your_batch_size em…That’s it :) Available for SqlClient and OracleClient Batches can execute inside a transaction The transaction has to be set in the command objects in the adapter Currently DataAdapter.Update does a round-trip per row New support for batching in Whidbey adapter.UpdateBatchSize = your_batch_size em…That’s it :) Available for SqlClient and OracleClient Batches can execute inside a transaction The transaction has to be set in the command objects in the adapter

9 9 Fast Updates

10 10 DataSet Performance Remoting One of the most common requests: “datasets are slow when used in remoting” We tweaked here and there Support for binary serialization Needs to be enabled on the DataSet instance Very fast serialize/deserialize Critical reduction of memory usage New, much faster index engine Great improvement on insert performance Remoting One of the most common requests: “datasets are slow when used in remoting” We tweaked here and there Support for binary serialization Needs to be enabled on the DataSet instance Very fast serialize/deserialize Critical reduction of memory usage New, much faster index engine Great improvement on insert performance

11 11 Binary DataSet Remoting (scale is logarithmic) Up to ~80 times faster

12 12 Agenda Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes

13 13 Simplified Deployment No MDAC requirement at all ADO.NET base, common and disconnected classes.NET managed providers for SQL Server & Oracle Use MDAC, but no new requirements OLEDB and ODBC managed providers 2.6, 2.7, 2.8 or 9.0 will do :) !!! (the PDC build still requires MDAC) No MDAC requirement at all ADO.NET base, common and disconnected classes.NET managed providers for SQL Server & Oracle Use MDAC, but no new requirements OLEDB and ODBC managed providers 2.6, 2.7, 2.8 or 9.0 will do :) !!! (the PDC build still requires MDAC)

14 14 Paging Straightforward API: ExecutePageReader Provide starting row and number of rows No consistency guarantees Outside a transaction, rows can be skipped or repeated Way faster than skipping rows in a large table Straightforward API: ExecutePageReader Provide starting row and number of rows No consistency guarantees Outside a transaction, rows can be skipped or repeated Way faster than skipping rows in a large table

15 15 One page at a time

16 16 Agenda Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes

17 17 User-Defined Types UDTs are CLR types that live in the DB Extend the database scalar type-system Instances ‘travel’ between server and client Seamless integration with ADO.NET You “just use objects” in the API i.e. datareader.GetValue or Parameter.Value=… Maintains encapsulation of the UDTs Same methods can be called inside and outside the server State representation remains private UDTs are CLR types that live in the DB Extend the database scalar type-system Instances ‘travel’ between server and client Seamless integration with ADO.NET You “just use objects” in the API i.e. datareader.GetValue or Parameter.Value=… Maintains encapsulation of the UDTs Same methods can be called inside and outside the server State representation remains private

18 18 Exchanging Objects with the Database

19 19 Multiple Active Result-Sets More than one simultaneous pending request per connection Multiple active data-readers Execute batches between Read() and Read() One active data-reader per command Built on top of SQL Server “Yukon” MARS More than one simultaneous pending request per connection Multiple active data-readers Execute batches between Read() and Read() One active data-reader per command Built on top of SQL Server “Yukon” MARS System.InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first.

20 20 SQL Server XML Data Type Seamless integration “It’s just a type” Data-reader Use SqlDataReader.GetSqlXmlReader Parameters Provide an XmlReader or a string as the value DataSet Surfaced as a XPathDocument For PDC build, DataSet will contain a XmlReader Seamless integration “It’s just a type” Data-reader Use SqlDataReader.GetSqlXmlReader Parameters Provide an XmlReader or a string as the value DataSet Surfaced as a XPathDocument For PDC build, DataSet will contain a XmlReader

21 21 Agenda Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes Key ADO.NET Whidbey Themes Faster Easier Yukon-enabled Common base classes

22 22 Common Provider Model ADO.NET v1.0/1.1 was based on interfaces Not enough to write provider-agnostic code Hard to evolve We’re introducing a common model Abstract base classes instead of interfaces Better versioning story 3 rd party providers can reuse our common code They can even re-use our connection pooler Provider-independent apps fully enabled at the API level This is an extension, no breaking changes ADO.NET v1.0/1.1 was based on interfaces Not enough to write provider-agnostic code Hard to evolve We’re introducing a common model Abstract base classes instead of interfaces Better versioning story 3 rd party providers can reuse our common code They can even re-use our connection pooler Provider-independent apps fully enabled at the API level This is an extension, no breaking changes

23 23 A set of classes to program to DbConnection, DbCommand, etc. This provides API independence SQL syntax is still database-specific Factory model to create provider objects Enables both connected and disconnected scenarios Can enumerate the installed providers Each provider has an invariant name ie. System.Data.SqlClient, System.Data.OracleClient A set of classes to program to DbConnection, DbCommand, etc. This provides API independence SQL syntax is still database-specific Factory model to create provider objects Enables both connected and disconnected scenarios Can enumerate the installed providers Each provider has an invariant name ie. System.Data.SqlClient, System.Data.OracleClient Db* Base Classes

24 24 Provider-agnostic

25 25 More features General connected stack Database schema retrieval Provider enumeration Integration with System.Transactions Tracing Connection pool reset API DataSet DataTable more stand-alone Full namespaces for tables DataSet.Load DataTableReader Flexibility on relationships DataTable from DataView with projection and unique rows General connected stack Database schema retrieval Provider enumeration Integration with System.Transactions Tracing Connection pool reset API DataSet DataTable more stand-alone Full namespaces for tables DataSet.Load DataTableReader Flexibility on relationships DataTable from DataView with projection and unique rows SqlClient Notifications SQL Server ‘Yukon’ types varchar/varbinary(max) Bulk-copy Server enumeration Change password on login Transparent failover Promotable transactions More to come… OleDb Managed pooling option OracleClient Batching for updates

26 26 ADO.NET Data Access Support DataReader and DataSet ObjectSpaces in ADO.NET Technology Strengths Use if… SQLXML in ADO.NET Business level objectsBusiness level objects Relational mapping via metadataRelational mapping via metadata Decoupled from database schemaDecoupled from database schema Smaller working set than other object abstractionsSmaller working set than other object abstractions Interoperability. Format for the Web – B2B, A2AInteroperability. Format for the Web – B2B, A2A Sparse (semi-structured) dataSparse (semi-structured) data XML Services e.g. XQuery, XSDXML Services e.g. XQuery, XSD Relational mapping via metadataRelational mapping via metadata Decoupled from database schemaDecoupled from database schema Relational (tabular) modelRelational (tabular) model Highest performanceHighest performance Explicit controlExplicit control Fully exposes database functionalityFully exposes database functionality You need a strong business object layerYou need a strong business object layer You need to query data from XML data sources e.g. XML Web ServicesYou need to query data from XML data sources e.g. XML Web Services You use vertical industry XML schemas for content publishing e.g. XBRL, RIXML, FinXMLYou use vertical industry XML schemas for content publishing e.g. XBRL, RIXML, FinXML You need to load XML documents into database tablesYou need to load XML documents into database tables You are using UI bound controls with XMLYou are using UI bound controls with XML You are comfortable with the relational modelYou are comfortable with the relational model You require maximum control/performance/functionalityYou require maximum control/performance/functionality You are using UI bound controlsYou are using UI bound controls Data is relational is objects is XML is Data

27 27 Related Sessions DAT400 - Programming SQL Server "Yukon" Using Managed Code ARC404 - Data Access Design Patterns: Navigating the Data Access Maze DAT402 - Building Database Applications with SQL Server "Yukon": XQuery, XML Datatype DAT405 - Caching Techniques for Scalable Enterprise Applications DAT410 -.NET Framework: Developing Applications Using the New Object-Relational Technologies in "Whidbey“ ARC380 -.NET Framework: What's New in System.Xml for "Whidbey" PNL05 - Client Architecture: The Zen of Data-Driven Applications DAT400 - Programming SQL Server "Yukon" Using Managed Code ARC404 - Data Access Design Patterns: Navigating the Data Access Maze DAT402 - Building Database Applications with SQL Server "Yukon": XQuery, XML Datatype DAT405 - Caching Techniques for Scalable Enterprise Applications DAT410 -.NET Framework: Developing Applications Using the New Object-Relational Technologies in "Whidbey“ ARC380 -.NET Framework: What's New in System.Xml for "Whidbey" PNL05 - Client Architecture: The Zen of Data-Driven Applications

28 28 Summary Whidbey: customer-driven ADO.NET Addressing customer requests Features, performance, usability Integration Great support for SQL Server “Yukon” ADO.NET continues to evolve No revolutions, no compatibility issues We’d love to hear your feedback! Ask The Experts, SQL Lounge and Booths Members of the dev team will be there! Whidbey: customer-driven ADO.NET Addressing customer requests Features, performance, usability Integration Great support for SQL Server “Yukon” ADO.NET continues to evolve No revolutions, no compatibility issues We’d love to hear your feedback! Ask The Experts, SQL Lounge and Booths Members of the dev team will be there!

29 29 SQL Server Resources Week long SQL Server “Ask the Experts” lounge in: Foyer outside Room 309 Support for SQL Server “Yukon” PDC Preview at SQLJunkies http://www.sqljunkies.com/forums SQL Server “Yukon” FAQ Blog at SQLTeam http://yukonblog.sqlteam.com/ Other Key Resources http://www.microsoft.com/sql/community http://msdn.microsoft.com/sqlserver/ 34 world wide user groups, http://msdn.microsoft.com/usergroups/find.asp Our most active SQL Server newsgroups, Microsoft.public.sqlserver.programming Microsoft.public.sqlserver.server Microsoft.public.sqlserver.dts Microsoft.public.sqlserver.olap Microsoft.public.sqlserver.setup Microsoft.public.sqlserver.replication Microsoft.public.sqlserver.msde Week long SQL Server “Ask the Experts” lounge in: Foyer outside Room 309 Support for SQL Server “Yukon” PDC Preview at SQLJunkies http://www.sqljunkies.com/forums SQL Server “Yukon” FAQ Blog at SQLTeam http://yukonblog.sqlteam.com/ Other Key Resources http://www.microsoft.com/sql/community http://msdn.microsoft.com/sqlserver/ 34 world wide user groups, http://msdn.microsoft.com/usergroups/find.asp Our most active SQL Server newsgroups, Microsoft.public.sqlserver.programming Microsoft.public.sqlserver.server Microsoft.public.sqlserver.dts Microsoft.public.sqlserver.olap Microsoft.public.sqlserver.setup Microsoft.public.sqlserver.replication Microsoft.public.sqlserver.msde

30 30 © 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "1 Programming ADO.NET in Whidbey Pablo Castro/Brad Rhodes ADO.NET Team Microsoft Corporation Pablo Castro/Brad Rhodes."

Similar presentations


Ads by Google