DataSource controls in.NET How to access databases.

Slides:



Advertisements
Similar presentations
ASP.NET User Controls Make your own controls by grouping other controls 1ASP.NET User Controls.
Advertisements

Direct Data Access, Data Binding. Content Direct Data Access Data Binding Muzaffer DOĞAN - Anadolu University2.
Turners SharePoint Web Site How we did it. 2 Page Anatomy Custom Search Web Part Custom Search Web Part Data Form Web Parts Content Query Web Part HTML.
Introduction to Database Processing with ADO.NET.
The ADO Data Control. Universal Data Access Open Database Connectivity (ODBC) –standard for accessing data in databases OLE-DB –allows access to data.
Installing sylib By, Tolga Ciftci. Main Aims Installing the website with the setup file –With SQL Express Server and user instancing.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
1 Enabling Secure Internet Access with ISA Server.
CONFIGURING WINDOWS SERVER MIS 424 Professor Sandvig.
Microsoft Windows 2003 Server. Client/Server Environment Many client computers connect to a server.
Web Site Navigation How to get around in an ASP.NET web application 1Web Site Navigation.
Philip Wolfe Senior Consultant Sogeti Session 3 - Leveraging Data in ASP.NET 2.0 (Level 200)
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Chapter 9 Using the SqlDataSource Control. References aspx.
Deployment of web Site. Preparing the web site for deployment you now have two versions of web site 1 -one running in the production environment 2-one.

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.
ASP.NET AJAX 1. Ordinary web applications vs. AJAX Ordinary web application The full page is updated at each request The page is not available while being.
ASP.NET Part 4 Instructor: Charles Moen CSCI/CINF 4230.
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
1 UCN Technology: Computer Science: Autumn 2012 ADO.NET 2.0 Architecture DataReader DataSet Connection factory Config file.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Building Data-Driven ASP.NET Web Forms Apps Telerik Software Academy ASP.NET Web Forms.
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.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
Module 4 : Installation Jong S. Bok
Copyright 2008 Judith A Copeland - Accessing The Database By Judi Copeland.
Caching Chapter 12. Caching For high-performance apps Caching: storing frequently-used items in memory –Accessed more quickly Cached Web Form bypasses:
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.
ADO.NET Data Access. Page  2 SQL  When we interact with the datasource through ADO.NET we use the SQL language to retrieve,modify,update information.
Slide 1 ASP Authentication There are basically three authentication modes Windows Passport Forms There are others through WCF You choose an authentication.
1.Net programmingADO.NETNOEA / PQC ADO.NET Architecture Connection factory Config file DataReader DataSet DataGrid Autogeneration of SQL.
ADO.NET connections1 Connecting to SQL Server and Oracle.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview How to create a first ASP.NET application.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 The SqlConnection Object ADO.NET - Lesson 02  Training time: 10 minutes 
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.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
Module 5 : Security I Jong S. Bok
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 12 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 12 Accessing.
ADO.NET FUNDAMENTALS BEGINNING ASP.NET 3.5 IN C#.
Configuring and Deploying Web Applications Lesson 7.
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.
DATABASE SYSTEM VB LINK TO MS-SQL. 2 Visual ProgrammingChapter 6 Select Project -> Component.
PERMISSION ANALYZER 2 Reports NTFS permissions from the file system combined with user and group data from the Active Directory.
Building web applications with the Windows Azure Platform Ido Flatow | Senior Architect | Sela | This session.
Data Control In this presentation… –databases supported –inserting a data control –data control properties –using the data control.
Murach's ASP.NET 4.5/C#, C4© 2013, Mike Murach & Associates, Inc.Slide 1.
Introduction to Database Processing with ADO.NET
Displaying and Updating Data
Current Popular IT I Pertemuan 5
Creating Data Base & Sql Data Source
PROG Advanced Web Apps 5/23/2018 Notes on ADO.NET (1) Wendi Jollymore, ACES.
Lecture 6 VB.Net SQL Server.
Active Data Objects Binding ASP.NET Controls to Data
Listing 9.1 ShowLocalConnection.aspx
ASP.NET Application Framework
VB.NET Using Database.
Developing Web Applications
Geospatial Database Create Geodatabase Practical Session
Using List Controls with SQL Server
Creating Data Base & Sql Data Source
Web Form Introduction.
Working with your database
Active Data Objects Binding ASP.NET Controls to Data
Security - Forms Authentication
Presentation transcript:

DataSource controls in.NET How to access databases

Where is that database? The physical database might be in many places – On another server IP address + port number required – On the same server, as the ASP.NET application If you work with a Microsoft SQL Server database put the database file (somename.mdf) in an APP_DATA folder in your ASP.NET project Data source controls in.NET2

DataSource Controls A DataSource control has access to a database AccessDataSource control – Access to a Microsoft Access Database SqlDataSource control – Access to a Microsoft SQL Server database Oracle – html html MySQL – – 3Data source controls in.NET

Asp:SqlDataSource examles <asp:SqlDataSource ID="SqlDataSource1" runat="server“ SelectCommand="select * from member" ConnectionString="Data Source=(local)\SQLEXPRESS; Initial Catalog=myfirst; Integrated Security=SSPI;"> <asp:SqlDataSource ID="SqlDataSource2“ runat="server" SelectCommand="select * from member" ConnectionString="Data Source=(local)\SQLEXPRESS; User Id=anders; Password=Secret12;"> (local) is sometimes written. (”dot”) 4Data source controls in.NET

Connection string Information needed to connect to the database – DataSource=ServerName\ServerInstance Server name can be –. – (local) – Localhost » didn’t work for me – The name of the server machine Server instance – Necessary if you have more than one instance of SQL Server on the server machine » Example: SQLEXPRESS – Catalog=myfirst The name of the database to connect to – Security Integrated Security: Use Windows authentication Provide Username/password More information – 5Data source controls in.NET

Connection string in web.config … <add name="myfirstConnectionString" connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=myfirst; Integrated Security=SSPI;" providerName="System.Data.SqlClient" /> <asp:SqlDataSource ID="SqlDataSource4" runat="server" SelectCommand="SELECT * FROM [member]" ConnectionString=" "> 6Data source controls in.NET

Data Source Mode Property DataSourceMode can have two values – DataSet Read-Write, forward/backwards Default value for the DataSourceMode property Allows filtering, sorting, and paging – DataReader Read-only, forward-only Fastest, most effecient 7Data source controls in.NET

Filtering data using SelectParameters <asp:SqlDataSource ID="SqlDataSource3" runat="server" SelectCommand="select * from member where ConnectionString="Data Source=(local)\SQLEXPRESS; Initial Catalog=myfirst; Integrated Security=SSPI;"> <asp:QueryStringParameter Name="memberID" QueryStringField="memberID" Type="String" /> 8Data source controls in.NET

References George Shepherd ASP.NET 4 Step by Step, Microsoft Press 2010 – Chapter 10 Data Binding, page Imar Spaanjaars Beginning ASP.NET 4 in C# and VB, Wrox/Wiley 2010 – Appendix B Configuring SQL Server 2008, page Bill Evjen Professional ASP.NET 4 in C# and VB, Wrox/Wiley 2010 – Chapter 7 Data Binding, page MSDN AccessDataSource class – us/library/system.web.ui.webcontrols.accessdatasource.aspx us/library/system.web.ui.webcontrols.accessdatasource.aspx MSDN SqlDataSource class – us/library/system.web.ui.webcontrols.sqldatasource.aspx us/library/system.web.ui.webcontrols.sqldatasource.aspx 9Data source controls in.NET