1 Databound Controls. 2 Objectives You will be able to use design time data binding to display and update SQL Server database data without writing any.

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

Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Chapter 5 Multitable Forms
Chapter 14.3 LINQ to SQL Programming in Visual Basic 2010: The Very Beginner’s Guide by Jim McKeown Databases – Part 3.
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.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Microsoft Visual Basic 2012 CHAPTER TEN Incorporating Databases with ADO.NET.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
Some Basic Database Terminology
Website Design CLA – Transportation. Defining a Site Select: Site – New - Site Click Next.
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Advanced Forms Lesson 10.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
1 Working with MS SQL Server Textbook Chapter 14.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Thirteen Working with Access Databases and LINQ.
 2006 Pearson Education, Inc. All rights reserved Database, SQL and ADO.NET.
CIS 338: Using Queries in Access as a RecordSource Dr. Ralph D. Westfall May, 2011.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
1 Chapter 12 – Web Applications 12.1 Programming for the Web, Part I 12.2 Programming for the Web, Part II 12.3 Using Databases in Web Programs.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Binding Basics.
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.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
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.
Chapter 2 – Introduction to the Visual Studio .NET IDE
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.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic nd Edition.
1 Database Programming with ADO.NET Kashef Mughal.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
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.
Understand Databound Controls Windows Development Fundamentals LESSON 4.2A.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
VB.NET and Databases. ADO.NET VB.Net allows you many ways to connect to a database. The technology used to interact with a database or data source is.
Chapter 9 Working with Databases. Copyright © 2011 Pearson Addison-Wesley Introduction In this chapter you will learn: – Basic database concepts – How.
Creating SQL Database file And Displaying a Database Table in a DataGridView.
DATA GRID VIEW objective of lecture:- After completing this lecture, you will be able to: Create a data grid view object on a windows form and use it to.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Common SQL keywords. Building and using CASE Tools Data Base with Microsoft SQL-Server and C#
Y.-H. Chen International College Ming-Chuan University Fall, 2004
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Visual Basic 2010 How to Program
Basic Database Concepts
Chapter 2 – Introduction to the Visual Studio .NET IDE
Incorporating Databases with ADO.NET
Incorporating Databases with ADO.NET
Brief description on how to navigate within this presentation (ppt)
CIS16 Application Programming with Visual Basic
Database Applications
Accessing Databases with ADO.NET, Handling Exceptions, and Printing
Chapter 10 Accessing Database Files
Database 2.
Presentation transcript:

1 Databound Controls

2 Objectives You will be able to use design time data binding to display and update SQL Server database data without writing any C# code.

3 References Beginning Visual C# 2005 Karli Watson, et al. Wrox Press, 2006 Chapter 25 Unchanged in Visual C# 2008

4 Northwind Traders Database Add the Northwind Traders database tables to your database on scorpius. Download SQL script to build tables: Downloads/ Downloads/ File add_northwind_tables.sql Open a command prompt window and run sqlcmd to execute the script. See next slide.

5 Execute the Script

6 Check Tables in Server Explorer

7 High Level Components Data Source Encapsulates Connection and Command objects. Databound Textbox Automatic updates both directions DataGridView Display entire table in grid format Automatic updates both directions

8 ProductData Application We will create a new version of the Northwind Product Browser using high level components. SQL Data Source Databound Textboxes Databound DataGridView No C# code!

9 ProductData Application Create a new C# Windows Forms Application. Name: ProductData Set form1 text property to Product Data DO NOT rename form1 On the following slides we will: Add a DataSource to the form. Configure to access Products table. Add databound textboxes for data.

10 ProductData Application

11 Form1

12 Add a Data Source On the Data menu, select Add New Data Source.

13 Data Source Configuration Wizard

14 Data Source Configuration Wizard Select connection to your SQL Server database. Or create a new connection if necessary.

15 Data Source Configuration Wizard

16 Data Source Configuration Wizard Expand Tables, then Products. Select columns. Click Finish.

17 DataSet in Solution Explorer

18 Show Data Sources To add databound controls to the form, select Show Data Sources on the Data menu

19 Show Data Sources

20 Adding a DataSet to the Program Expand Products. Drag ProductName to design surface.

21 Adding a DataSet to the Program Build and run.

22 App Running Note navigation controls.

23 Add Data to Form Drag other columns to the design surface. Arrange and resize labels and textboxes. Build and run

24 Add Data to Form

25 App Running End of Section Note that you can update the data and save it back to the database. Click the floppy disk icon to save.

26 Using a DataGridView The DataGridView allows us to display an entire table as a grid. DataBinding permits all work to be done at design time. No C# code required!

27 Using a DataGridView Create a new project called Product_Grid Set form1 Text property to Northwind Products. DO NOT rename form1. Add a data source as before. Same configuration. Show Data Sources.

28 Using a DataGridView Drag the Products Table to the design surface.

29 Using a DataGridView Resize the form and the data grid.

30 Using a DataGridView Anchor the data grid on all four sides. Build and run.

31 Products_Datagrid Running

32 Update Note that we can update data shown on the grid. Clicking the “Save” icon will update the database.

33 Summary Databound Controls permit us to create an data driven application with zero code. Just configure high level components. Internally these controls use the low level ADO classes that we saw previously.