Download presentation
Presentation is loading. Please wait.
Published byClement Terry Modified over 8 years ago
1
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd mpelton@microsoft.com
2
Agenda Goals New Features Run time Design Time, Layout, and Configuration ADO.NET 2 New Data Features for WinForms Deployment
3
Windows Forms 2.0 Goals Bring the ease and reliability of Web application deployment to client applications Professional Look and Feel New controls and enhancements Simplify client application development Simplify working with data Fewer lines of code Fewer clicks
4
New Runtime Features Controls Professional ToolBars and Menus (ToolStrip) Data Controls DataGridView (new Grid Control) DataContainer (now DataConnector) Splitter Container Web Browser MaskedEdit Grid and Flow Layout
5
Runtime Features Productivity Client Configuration Read/Write User Settings Read Only Application Settings Asynchronous Component Sound API Improved Printing API XP control and Operating System features Enhanced Existing Controls
6
New Designer Features Design Time In-situ Property Editing Smart Tasks Designer Layout Assistance and Usability Hide Initialize Component User Control Container
7
Other New Features Layout Table and Flow Layout Controls Configuration Read/Write User Configuration Settings Read Only Application Settings
8
But What About ADO.NET? Evolution Disconnected stack enhancements Provider-independent API SQL Server 2005 integration
9
Performance Three-tier application Uses remoting and DataSets to exchange data between tiers Both client server and server client Performance is not great DataSet serializes as XML even with the binary formatter High CPU, memory and bandwidth usage Making changes to DataSet is slow in large DataSets
10
XML vs Binary Serialization Remoting end-to-end speed
11
Performance In DataSet New binary remoting option in DataSet Reduction in memory, CPU, and bandwidth Improvement in end to end time (Latency) Disabled by default (for compatibility) DataSet.RemotingFormat property Index engine Changes to DataSet are simply faster Index update time close to constant, instead of close to linear
12
Usability Stand-alone DataTable Your application needs only one table at some given point E.g. return value from a webservice You need to create a DataSet anyway Streaming You have a DataReader, but want a table Or… You have a DataTable, but want a reader
13
Usability DataTable enhancements Most common DataSet operations made available on DataTable ReadXml, WriteXml, webservices/remoting Integrate with streaming interfaces DataReader DataTable: Load() New options: PreserveCurrentValues, UpdateCurrentValues, OverwriteRow DataTable DataReader: DataTableReader
14
Scenario: Unknown Server You’re writing a database-centric tool or application Don’t know the database upfront Don’t want to have completely different code- paths for each database vendor IDb* interfaces don’t seem to be enough
15
Provider-Independent API ADO.NET v1.1 is based on interfaces Not enough for provider-agnostic code Hard to evolve ADO.NET v2.0 introduces a common API Using abstract base classes instead of interfaces Better versioning story Provider-independent apps fully enabled at the API level :) SQL syntax is still back-end specific
16
Scenario: Multiple Changes Your application uses DataSets A user or process makes multiple changes Adds, changes and removes rows You use the DataAdapter to propagate updates to the database server The DataAdapter does one round-trip per changed row This may impact performance
17
SQL Server 2005: Batch Updates New support for batching adapter.UpdateBatchSize = your_batch_size That’s it! Batches can execute inside a transaction for added speed and consistency Availability Also works with SQL Server 7.0, 2000 Also available in OracleClient
18
Scenario: Stale Data Caching in the middle tier You keep some cache data in your middle-tier E.g. in a DataSet Need to have an artificial expiration policy so the cache doesn’t go too stale E.g. expire by timeout It would be nice to flush the cache only when the underlying data changes
19
Dependencies SqlDependency tracks dependencies on query results Works in conjunction with the server Built on top of SQL Server 2005 Query Notifications Straightforward use Bind the dependency to the command Execute the command We’ll fire an event if the data changes Requires SQL Server 2005 and.NET 2.0
20
Multiple Active Result-Sets Previous versions of SQL Server Only one pending statement per connection “MARS” relaxes that restriction Multiple results can be active Caller can interleave fetches to each of them Non-resultset-returning operations can also be interleaved Requires SQL Server 2005 and.NET 2.0
21
Windows Forms New Data Features Goal: Simplify and enhance data access New Data controls DataGridView Control DataConnector Component Data Design Time Data Bases Web Services Business Objects
22
“ClickOnce” Deployment Deployment issues blocked rich client’s success Goal: Make rich client deployment as easy as Web deployment “ClickOnce”Offline Desktop Integration Permission elevation
23
© 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.