Making the Most of WinForms 2.0 Data Binding Rajiv Sodhi Microsoft India.

Slides:



Advertisements
Similar presentations
Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Advertisements

Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
 Open the Paradise.exe file  Application displays records in the Books database  Allows the store manager to enter an author’s name (or part of a name)
Chapter 14.3 LINQ to SQL Programming in Visual Basic 2010: The Very Beginner’s Guide by Jim McKeown Databases – Part 3.
1 Web-Enabled Decision Support Systems Database Connectivity with ADO.NET Prof. Name Position (123) University Name.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
1 Web-Enabled Decision Support Systems Advance Topics in Database Connectivity Prof. Name Position (123) University Name.
ASP.NET Data Binding. Slide 2 Lecture Overview Understanding the ASP.NET data binding model.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Introduction to Data Adapter. A Simplified View of ADO.Net Objects Ado.Net Data Provider Connection Adapter Command Reader Dataset Data Consumer WinForm.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Windows Forms in Visual Studio 2005: An in-depth look at key features Name: Mike Henderlight Title: Program Manager.
VB.NET Database Access ISYS 812. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
C# Programming: From Problem Analysis to Program Design1 Working with Databases C# Programming: From Problem Analysis to Program Design 3 rd Edition 14.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Visual Basic 2005 and Windows Forms 2.0 Enhancements Tyler Whitney Microsoft, Corp.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS546.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Introduction to ADO.Net and Visual Studio Database Tools
From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing.
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Using the Actions Pane, Host Controls, and Smart Tags
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
ADO.NET Tools and Wizards. Slide 2 Data Sources Window (Introduction) Use the Data Sources window to Establish a connection Create bound control instances.
DEV397 Windows Forms Databinding Mike Henderlight Program Manager Windows Forms Microsoft Corporation.
Advanced Visual Basic th Edition Chapter 3: Using SQL Server Databases (c) 2007 Pearson Education Inc. All rights reserved. You may modify and copy.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
.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.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Thirteen Working with Access Databases and LINQ.
Connecting to Data Sources Using ADO.NET Dr. Awad Khalil Computer Science & Engineering Department AUC.
CHAPTER EIGHT Accessing Data Processing Databases.
 2006 Pearson Education, Inc. All rights reserved Database, SQL and ADO.NET.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
Neal Stublen Tonight’s Agenda  Database Errors  Parameterized queries  ToolStrip control  Master-detail relationships  Custom.
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd
Module 4: Building DataSets. Overview Working in a Disconnected Environment Building DataSets and DataTables Binding and Saving a DataSet Defining Data.
Using Adapter Wizard ISYS 512. Data Adapter Wizard – 2 nd Level of Using ADO.Net Configure Data Adapter and generating a dataset: –From the Data tab of.
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
Databases with LINQ. LINQ to SQL LINQ to SQL uses LINQ syntax to query databases. LINQ to SQL classes are automatically generated by the IDE’s LINQ to.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
Windows Forms in Visual Studio 2005: An in-depth look at key features Name: Joe Stegman Title: Lead Program Manager Session code.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Module 5 Data Classes DataView – DataGridView Control 1.
Understand Databound Controls Windows Development Fundamentals LESSON 4.2A.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 350.
Chapter 9 Working with Databases. Copyright © 2011 Pearson Addison-Wesley Introduction In this chapter you will learn: – Basic database concepts – How.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Using Data in Microsoft Visual Studio 2005 Tools for the Microsoft Office System Mike Hernandez Product Manager Visual Studio Tools for Office.
Integrating Data Lesson 6.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Visual Basic 2010 How to Program
Chris Menegay Sr. Consultant TECHSYS Business Solutions
VB.NET Using Database.
Brief description on how to navigate within this presentation (ppt)
Database Applications
Chapter 10 Accessing Database Files
Windows Forms in Visual Studio 2005: An in-depth look at key features
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Making the Most of WinForms 2.0 Data Binding Rajiv Sodhi Microsoft India

Agenda Introduction to Data Binding New Objects and Enhancements Master-Detail Data Binding Object Data Binding

Data Sources Window Drag and drop operations Dragging/dropping tables from Data Sources Window onto form will create instances of: DataSet, TableAdapter, BindingSource BindingNavigator with nav/add/delete/save controls Bound control(s) Use Data Sources window to configure: Whether table will be edited with DataGridView or “Details” mode (individual controls) Mapping of detail control types to column data types (shortcut to Windows Forms Designer/Data UI Customization node in Options dialog)

Data Source Options Database (DataSet) Any ADO.NET data source Web Service Web Service Bind to parameterized methods of a Web service, for select, update, delete, and insert operations Object Object Bind to instances of classes and their properties (more later!)

Smart Defaults Control names Label captions Controlling through Caption property of Column objects in typed DataSets Automatic addition of typed DataSets and their DataTables to toolbox

Data Sources Window - Drag and Drop Completely Customizable Changing existing binding Establishing list/lookup binding DisplayMemberValueMemberSelectedValue Use of SmartTag More Smart Defaults

Drag and Drop Binding Data Sources Window Drag and Drop Data Binding Binding Controls

Agenda Introduction to Data Binding New Objects and Enhancements Master-Detail Data Binding Object Data Binding

WinForms 2.0 Data Binding Introduction to Objects Typed DataSet DataTable, TableAdapter BindingSource[BindingNavigator]

Strongly-Typed DataSets As before Consist of DataTables, Relations, Constraints Drag/drop from Server Explorer is supported Based on XML schema and code-behind class Also consists of TableAdapters Encapsulate a DataAdapter and a Connection Enhanced Typed Dataset Designer Instead of XSD Designer earlier Partial class support

TableAdapters Have Queries (methods for handling selects, updates, inserts, deletes) Queries exists as methods Fully customizable and extendable Can be re-used across multiple forms Have Connection property Connection string typically stored in web/app.config; default value applied in WinForms apps.

BindingSource: Basics Acts as “broker” between bound controls and actual data source DataSource, DataMember Point to typed DataSet, DataTable AllowEdit, AllowNew, AllowRemove Filter, Sort properties Run time: RemoveFilter, RemoveSort methods

BindingSource Run time members MovePrevious, MoveNext, MoveFirst, MoveLast, Position, Count properties (handles all navigation) AddNew, Insert(index, obj) methods RemoveCurrent, RemoveAt(index), Remove(obj) EndEdit, CancelEdit methods Works with edits and inserts/new’s Use of most of these is optional due to…

BindingNavigator UI provider that wraps navigation and maintenance functionality of BindingSource Not like old VB data control Has UI component Specialized toolstrip Has tray component too Selecting one will select both Members that associate ToolStrip controls with specific actors DeleteItem = bindingNavigatorDeleteItem (ToolStripButton)

How It All Connects BindingSource DataSet DataTable DataSource DataMember Simple Control Complex Control Column DataBinding Property Changes control contents via navigation, maintenance BindingNavigator BindingSource DataSource

Complex and Simple Binding Scenarios Complex Binding DataGridView.DataSource = BindingSource SimpleBinding TextBox.Text (and other controls/string-based properties) bound to member of BindingSource BindingNavigator.BindingSource = BindingSource

Introducing New Objects Typed Dataset Designer Customizable Typed TableAdapter Complex Binding Scenario Simple Binding Scenario

Agenda Introduction to Data Binding New Objects and Enhancements Master-Detail Data Binding Object Data Binding

Master-Detail Scenarios Binding to child rows Use of Typed DataSet Relations/Foreign Keys as data sources Precision drag & drop techniques Drop the child table, not the sibling

Master-Detail Binding

Agenda Introduction to Data Binding New Objects and Enhancements Master-Detail Data Binding Object Data Binding

Object Binding Binding to single objects Binding to BindingList Binding to BindingList AllowNew scenarios: AddingNew events on BindingSource and BindingList AllowNew scenarios: AddingNew events on BindingSource and BindingList Support for master-detail binding

Object Binding

Resources MSDN Smart Client Developer Center: Soup to Nuts: Build Windows Forms Applications with.NET (Webcasts and Virtual Labs): WindowForms.NET Whidbey Page: Improved Data Support Page: =2&ItemID=8&Cat=Runtime&tabindex=5 Newgroups: microsoft.public.dotnet.framework.windowsforms microsoft.public.dotnet.framework.windowsforms comp.lang.basic.visual.misc

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