Listing 9.1 ShowLocalConnection.aspx

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

User Controls, Master Pages, GridView. Content User Controls Styles, Themes, Master Pages Working with Data GridView Muzaffer DOĞAN - Anadolu University2.
Chapter 9 Customizing Data with Web Controls. ASP.NET 2.0, Third Edition2.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Chapter 4B: More Advanced PL/SQL Programming
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Stored Procedures Dr. Ralph D. Westfall May, 2009.
PL/SQL and the Table API. Benefits of Server-Side Code Speedy Pizza MENU NAPOLITAINE PIZZA Reduced network traffic Maintainability Data integrity Triggers.
Philip Wolfe Senior Consultant Sogeti Session 3 - Leveraging Data in ASP.NET 2.0 (Level 200)
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Chapter 9 Using the SqlDataSource Control. References aspx.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Chapter 10 Managing Data with ASP.NET. ASP.NET 2.0, Third Edition2.
Chapter 81 Building Data-Driven Web Applications Introduction to ASP.NET By Kathleen Kalata.
Chapter 71 Building Data-Driven ASP.NET Applications Introduction to ASP.NET By Kathleen Kalata.
Navigating database with windows forms.. Tiered applications  Provide a means to develop many presentations of the same app  Makes changes to the back.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
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.
Malek Kemmou Technology Architect, Application Platform Microsoft Middle East and Africa Using Visual Studio 2005 to Build Data- Driven.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
Chapter 8 Working With Databases in ASP.NET. Listing 8.1 – ShowListControls Uses The SqlDataSource control for estabishing database connectivity and.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflows can be triggered by inputs that are designed to execute code, or alter the way the program.
Object Oriented Software Development 10. Persistent Storage.
Microsoft Access 2013 ®® Tutorial 10 Automating Tasks with Macros.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
11 The Repeater Control. 22 Objectives You will be able to use a Repeater Control to display data obtained with a SQL query with custom formatting.
Reference: “ASP.NET 2.0 Illustrated” by Alex Homer and Dave Sussman. -ch3 illustrated book
Oracle10g Developer: PL/SQL Programming1 Objectives SQL queries within PL/SQL Host or bind variables The %TYPE attribute Include queries and control structures.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflow Analysis of Buffer Overflow Attacks.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 12 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 12 Accessing.
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.
Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic nd Edition.
HNDIT Rapid Application Development
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
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.
IMS 4212: Constraints & Triggers 1 Dr. Lawrence West, Management Dept., University of Central Florida Stored Procedures in SQL Server.
BR SQL SUPPORT I have a legacy application and I don’t intend to rewrite it any time soon. Why should I be concerned with this?
Data Control In this presentation… –databases supported –inserting a data control –data control properties –using the data control.
Common SQL keywords. Building and using CASE Tools Data Base with Microsoft SQL-Server and C#
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Creating Data Base & Sql Data Source
Visual Basic 2010 How to Program
Unit 9.1 Learning Objectives Data Access in Code
Database vs. DBMS Database Database Management System
A very brief introduction
PL/SQL Scripting in Oracle:
VB.NET Using Database.
The University of Texas – Pan American
Using List Controls with SQL Server
Chapter 10 ADO.
Database Applications
Creating Data Base & Sql Data Source
Chapter 8 Advanced SQL.
Chapter 10 Accessing Database Files
Database SQL.
Introduction to Web programming
Unit – V Data Controls.
Presentation transcript:

Listing 9.1 ShowLocalConnection.aspx If you set the ConnectionString inside the SqlDataSource, then you need to repeat this string for EVERY data source. What if you need to take this to another computer with a different required connection string? You’ll need to change EVERY copy of the string!

Web.config File Instead, you can define your connection strings in the web.config file. Above are the first few lines of the web.config file. Web.config is an XML file. The root element is <configuration>. <connectionStrings> is a sub-element, and allows you to specify connection strings for any number of datbases using <add> elements.

Listing 9.5 ShowMovies.aspx Using a connection string from the web.config file. You don’t have to change ShowMovies.aspx if you move it somewhere else. Just change the web.config file.

Listing 9.7 ShowInlineCommands.aspx DELETE EDIT NEW

Listing 9.7 ShowInlineCommands.aspx The buttons that appear in the DetailsView are based on these three properties.

The DetailsView and its associated SqlDataSource

Listing 9.7 ShowInlineCommands.aspx By setting AutoGenerateRows to false, and defining a Fields collection composed of BoundField objects, you can control the displays that appear. BoundField properties: DataField – bind to column from query HeaderText – control the header that appears

Listing 9.9 ShowMovieCount.aspx

Stored Procedures are actual database objects (just like tables), stored in a DBMS (like SQL Server or Oracle). Stored procedures can perform multiple queries sequentially, apply conditional logic (like if-statements) , looping, and even recursion.

Listing 9.10 ShowFilterExpression.aspx A FilterExpression can be used instead of a WHERE clause for a SelectCommand.

Listing 9.12 HandleError.aspx Error-checking code Event gets triggered by a Select query taking place, and is handled by a C# event handler method.

Listing 9.13 GridViewHandleError.aspx Error-checking code Event gets triggered by an Update attempt, and is handled by a C# event handler method.

Listing 9.14 CancelCommand.aspx

Listing 9.15 ShowDetailsView.aspx If you want to start out in edit mode, set the DefaultMode property accordingly