SlideShare a Scribd company logo
Chapter 9 Using ADO.NET
Overview ,[object Object],[object Object],[object Object],[object Object]
Introducing ADO.NET ,[object Object],[object Object],[object Object]
ADO.NET architecture
ADO.NET data providers  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ADO.NET data providers  ,[object Object],[object Object],[object Object],[object Object],[object Object]
ADO.NET namespaces
Abstract Base Classes of a Data Provider Class Description DbCommand  Executes a data command, such as a SQL statement or a stored procedure.  DbConnection  Establishes a connection to a data source.  DbDataAdapter  Populates a  DataSet  from a data source.  DbDataReader  Represents a read-only, forward-only stream of data from a data source.
ADO.NET data providers
Using Data Provider Classes ,[object Object],[object Object],[object Object],[object Object]
DBConnection ,[object Object],[object Object],[object Object]
DBConnection ,[object Object],[object Object],[object Object],[object Object]
Connection Strings ,[object Object],[object Object],[object Object],[object Object],name1=value1; name2=value Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:atabc.mdb;
Programming a DbConnection ,[object Object],[object Object],[object Object],[object Object],[object Object],// Must use @ since string contains backslash characters string connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:atabc.mdb;" OleDbConnection conn = new OleDbConnection(connString); conn.Open(); // Now use the connection … // all finished, so close connection conn.Close();
Exception Handling ,[object Object],[object Object],string connString = … OleDbConnection conn = new OleDbConnection(connString); try { conn.Open(); // Now use the connection … } catch (OleDbException ex) { // Handle or log exception } finally { if (conn != null) conn.Close(); }
Alternate Syntax ,[object Object],[object Object],[object Object],using (OleDbConnection conn = new OleDbConnection(connString)) { conn.Open(); // Now use the connection … }
Storing Connection Strings ,[object Object],<configuration> <connectionStrings> <add name=&quot;Books&quot; connectionString=&quot;Provider=…&quot; />  <add name=&quot;Sales&quot; connectionString=&quot;Data Source=…&quot; />  </connectionStrings> <system.web> … </system.web> </configuration> string connString = WebConfigurationManager.ConnectionStrings[&quot;Books&quot;].ConnectionString;
Connection Pooling ,[object Object],[object Object],[object Object],[object Object]
Connection Pooling ,[object Object],[object Object]
DbCommand ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Programming a DbCommand ,[object Object],[object Object],[object Object],string connString = &quot;…&quot; OleDbConnection conn = new OleDbConnection(connString);   // create a command using SQL text string cmdString = &quot;SELECT Id,Name,Price From Products&quot;; OleDbCommand cmd = new OleDbCommand(cmdString, conn);   conn.Open(); ...
Executing a DbCommand ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using DbParameters ,[object Object],[object Object],[object Object],[object Object]
Why String Building is Bad ,[object Object],[object Object],[object Object],[object Object],[object Object],// Do not do this string sql = &quot;SELECT * FROM Users WHERE User='&quot; + txtUser.Text + &quot;'&quot;;
SQL Injection Attack ,[object Object],[object Object],[object Object],[object Object],[object Object],string sql = &quot;SELECT * FROM Users WHERE User='&quot; + txtUser.Text + &quot;'&quot;; ' or 1=1 -- SELECT * FROM Users WHERE User='' OR 1=1 --' '; DROP TABLE customers; --
DbParameter ,[object Object],[object Object],[object Object],[object Object]
Using a DbParameter ,[object Object],[object Object],[object Object],[object Object],[object Object],SqlParameter param = new SqlParameter(&quot;@user&quot;,txtUser.Text); string s = &quot;select * from Users where UserId=@user&quot;; SqlCommand cmd; … cmd.Parameters.Add(param);
Transactions ,[object Object],[object Object],[object Object]
Local Transasctions ,[object Object]
Local Transaction Steps ,[object Object],[object Object],[object Object],[object Object],[object Object]
Distributed Transactions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Distributed transactions  ,[object Object]
DbDataReader  ,[object Object],[object Object],[object Object]
Programming a DbDataReader ,[object Object],[object Object],string connString = &quot;…&quot; OleDbConnection conn = new OleDbConnection(connString);   string cmdString = &quot;SELECT Id,ProductName,Price From Products&quot;; OleDbCommand cmd = new OleDbCommand(cmdString, conn);   conn.Open(); OleDBDataReader reader = cmd.ExecuteReader();   someControl.DataSource =  reader ; someControl.DataBind();   reader.Close(); conn.Close();
Programming a DbDataReader ,[object Object],[object Object],[object Object],OleDBDataReader reader = cmd.ExecuteReader(); while ( reader.Read() ) { // process the current record } reader.Close();
Programming a DbDataReader ,[object Object],SELECT Id,ProductName,Price FROM Products // retrieve using column name int id = (int)reader[&quot;Id&quot;]; string name = (string)reader[&quot;ProductName&quot;]; double price = (double)reader[&quot;Price&quot;];   // retrieve using a zero-based column ordinal int id = (int)reader[0]; string name = (string)reader[1]; double price = (double)reader[2];   // retrieve a typed value using column ordinal int id = reader.GetInt32(0); string name = reader.GetString(1); double price = reader.GetDouble(2);
DbDataAdapter  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Programming a DbDataAdapter DataSet ds = new DataSet();   // create a connection SqlConnection conn = new SqlConnection(connString);   string sql = &quot;SELECT Isbn,Title,Price FROM Books&quot;; SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);   try { // read data into DataSet adapter.Fill(ds);   // use the filled DataSet } catch (Exception ex) { // process exception }
Data provider-independent ADO.NET coding ,[object Object],[object Object],[object Object],OleDbConnection conn = new OleDbConnection(connString); … OleDbCommand cmd = new OleDbCommand(cmdString, conn); … OleDBDataReader reader = cmd.ExecuteReader(); … SqlConnection conn = new SqlConnection(connString); … SqlCommand cmd = new SqlCommand(cmdString, conn); … SqlDataReader reader = cmd.ExecuteReader(); …
Data provider-independent ADO.NET coding ,[object Object],DbConnection  conn = new SqlConnection(connString);
Data provider-independent ADO.NET coding ,[object Object],[object Object],string invariantName = &quot;System.Data.OleDb&quot;; DbProviderFactory factory = DbProviderFactories.GetFactory(invariantName);   DbConnection conn = factory.CreateConnection(); conn.ConnectionString = connString;   DbCommand cmd = factory.CreateCommand(); cmd.CommandText = &quot;SELECT * FROM Authors&quot;; cmd.Connection = conn;
Data Source Controls ,[object Object],[object Object],[object Object],[object Object]
Data Source Controls ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using Data Source Controls ,[object Object],<asp:AccessDataSource ID=&quot; dsBooks &quot; runat=&quot;server&quot;  DataFile=&quot;App_Data/BookCatalogSystem.mdb&quot; SelectCommand=&quot;Select AuthorId,AuthorName from Authors&quot; /> <asp:DropDownList ID=&quot;drpAuthors&quot; runat=&quot;server&quot;  DataSourceID=&quot;dsBooks&quot;  DataTextField=&quot;AuthorName&quot; /> <asp:SqlDataSource ID=&quot; dsArt &quot; runat=&quot;server&quot; ConnectionString=&quot;<%$ ConnectionStrings:Books %>&quot; ProviderName=&quot;System.Data.SqlClient&quot; SelectCommand=&quot;Select AuthorId,AuthorName From Authors&quot; /> <asp:DropDownList ID=&quot;drpAuthors&quot; runat=&quot;server&quot;  DataSourceID=&quot;dsArt&quot;  DataTextField=&quot;AuthorName&quot; />
Using Parameters ,[object Object],[object Object],[object Object],<asp:SqlDataSource ID=&quot;dsArt&quot; runat=&quot;server&quot; ConnectionString=&quot;<%$ ConnectionStrings:Books %>&quot; SelectCommand=&quot;Select AuthorId,AuthorName From Authors&quot; >   <SelectParameters>   Parameter control definitions go here   </SelectParameters>   </asp:SqlDataSource>
Parameter Types ,[object Object],[object Object],[object Object],[object Object],[object Object]
Parameter Control Types ,[object Object],Property Description ControlParameter Sets the parameter value to a property value in another control on the page. CookieParameter Sets the parameter value to the value of a cookie. FormParameter Sets the parameter value to the value of a HTML form element.  ProfileParameter Sets the parameter value to the value of a property of the current user profile. QuerystringParameter Sets the parameter value to the value of a query string field. SessionParameter Sets the parameter value to the value of an object currently stored in session state.
Using Parameters <asp:DropDownList ID=&quot; drpPublisher &quot; runat=&quot;server&quot; DataSourceID=&quot;dsPublisher&quot; DataValueField=&quot;PublisherId&quot; DataTextField=&quot;PublisherName&quot; AutoPostBack=&quot;True&quot;/> … <asp:SqlDataSource ID=&quot;dsBooks&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.OleDb&quot; ConnectionString=&quot;<%$ ConnectionStrings:Catalog %>&quot; SelectCommand=&quot;SELECT ISBN, Title FROM Books WHERE  PublisherId=@Pub &quot;>   <SelectParameters> <asp:ControlParameter ControlID=&quot;drpPublisher&quot;  Name=&quot;Pub&quot; PropertyName=&quot;SelectedValue&quot; /> </SelectParameters> </asp:SqlDataSource>
How do they work? ,[object Object],[object Object],[object Object]
Data Source Control Issues ,[object Object],[object Object],[object Object],[object Object],[object Object]
Data Source Control Issues ,[object Object],[object Object],[object Object]
ObjectDataSource ,[object Object],[object Object],[object Object],[object Object],[object Object]
Using the ObjectDataSource ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],<asp:ObjectDataSource ID=&quot;objCatalog&quot; runat=&quot;server&quot;  SelectMethod=&quot;GetAll&quot; TypeName=&quot;PublisherDA&quot; />

More Related Content

What's hot

Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.Net
FaRid Adwa
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
Snehal Harawande
 
For Beginners - Ado.net
For Beginners - Ado.netFor Beginners - Ado.net
For Beginners - Ado.netTarun Jain
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
DrSonali Vyas
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
prabhu rajendran
 
Chap14 ado.net
Chap14 ado.netChap14 ado.net
Chap14 ado.net
mentorrbuddy
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentalsMadhuri Kavade
 
Ado.net
Ado.netAdo.net
Ado.net
Om Prakash
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb netZishan yousaf
 
Vb.net session 05
Vb.net session 05Vb.net session 05
Vb.net session 05Niit Care
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
Fernando G. Guerrero
 
Ado.net &amp; data persistence frameworks
Ado.net &amp; data persistence frameworksAdo.net &amp; data persistence frameworks
Ado.net &amp; data persistence frameworks
Luis Goldster
 
Ado.net
Ado.netAdo.net
Ado.net
Vikas Trivedi
 
Ado.net
Ado.netAdo.net
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
Randy Connolly
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql server
Ammara Arooj
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12Sisir Ghosh
 

What's hot (20)

ADO.NET
ADO.NETADO.NET
ADO.NET
 
Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.Net
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
 
For Beginners - Ado.net
For Beginners - Ado.netFor Beginners - Ado.net
For Beginners - Ado.net
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 
Chap14 ado.net
Chap14 ado.netChap14 ado.net
Chap14 ado.net
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentals
 
Ado.net
Ado.netAdo.net
Ado.net
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
 
Database Connection
Database ConnectionDatabase Connection
Database Connection
 
Vb.net session 05
Vb.net session 05Vb.net session 05
Vb.net session 05
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
Ch 7 data binding
Ch 7 data bindingCh 7 data binding
Ch 7 data binding
 
Ado.net &amp; data persistence frameworks
Ado.net &amp; data persistence frameworksAdo.net &amp; data persistence frameworks
Ado.net &amp; data persistence frameworks
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql server
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12
 

Viewers also liked

ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
Kumar S
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Peter Gfader
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
WE-IT TUTORIALS
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
SAMIR BHOGAYTA
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
Rishi Kothari
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05Niit Care
 
Ado.net session01
Ado.net session01Ado.net session01
Ado.net session01Niit Care
 
ASP.NET y VB.NET paramanejo de base de datos
ASP.NET y VB.NET paramanejo de base de datosASP.NET y VB.NET paramanejo de base de datos
ASP.NET y VB.NET paramanejo de base de datos
José de Jesús Arenas Alvarez
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
nspyre_net
 
Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5
Ehtsham Khan
 
Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1
Bhushan Mulmule
 
Dotnet differences compiled -1
Dotnet differences compiled -1Dotnet differences compiled -1
Dotnet differences compiled -1
Umar Ali
 
05 entity framework
05 entity framework05 entity framework
05 entity frameworkglubox
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
Julie Lerman
 

Viewers also liked (18)

Asp.net.
Asp.net.Asp.net.
Asp.net.
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05
 
Ado.net session01
Ado.net session01Ado.net session01
Ado.net session01
 
ASP.NET y VB.NET paramanejo de base de datos
ASP.NET y VB.NET paramanejo de base de datosASP.NET y VB.NET paramanejo de base de datos
ASP.NET y VB.NET paramanejo de base de datos
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
 
Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5
 
Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1
 
Dotnet differences compiled -1
Dotnet differences compiled -1Dotnet differences compiled -1
Dotnet differences compiled -1
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 

Similar to ASP.NET 09 - ADO.NET

Ado.Net
Ado.NetAdo.Net
Ado.Net
LiquidHub
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
AISHWARIYA1S
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
Aravindharamanan S
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
Aravindharamanan S
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net Architecture
Umar Farooq
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to adoHarman Bajwa
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
Ali Shah
 
Ado dot net complete meterial (1)
Ado dot net complete meterial (1)Ado dot net complete meterial (1)
Ado dot net complete meterial (1)Mubarak Hussain
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
Sadhana Sreekanth
 
Csharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxCsharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptx
facebookrecovery1
 
Connected data classes
Connected data classesConnected data classes
Connected data classesaspnet123
 
Asp.Net Database
Asp.Net DatabaseAsp.Net Database
Asp.Net Database
Ram Sagar Mourya
 
Jdbc
JdbcJdbc
30 5 Database Jdbc
30 5 Database Jdbc30 5 Database Jdbc
30 5 Database Jdbcphanleson
 

Similar to ASP.NET 09 - ADO.NET (20)

Ado.Net
Ado.NetAdo.Net
Ado.Net
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net Architecture
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
Unit4
Unit4Unit4
Unit4
 
Ado dot net complete meterial (1)
Ado dot net complete meterial (1)Ado dot net complete meterial (1)
Ado dot net complete meterial (1)
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
 
Ado.net
Ado.netAdo.net
Ado.net
 
Csharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxCsharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptx
 
Connected data classes
Connected data classesConnected data classes
Connected data classes
 
Asp.Net Database
Asp.Net DatabaseAsp.Net Database
Asp.Net Database
 
Jdbc
JdbcJdbc
Jdbc
 
B_110500002
B_110500002B_110500002
B_110500002
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Mvc acchitecture
Mvc acchitectureMvc acchitecture
Mvc acchitecture
 
30 5 Database Jdbc
30 5 Database Jdbc30 5 Database Jdbc
30 5 Database Jdbc
 
JDBC.ppt
JDBC.pptJDBC.ppt
JDBC.ppt
 

More from Randy Connolly

Celebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and DisciplinesCelebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and Disciplines
Randy Connolly
 
Public Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI CrisisPublic Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI Crisis
Randy Connolly
 
Why Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social SciencesWhy Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social Sciences
Randy Connolly
 
Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS Degree
Randy Connolly
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)
Randy Connolly
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Randy Connolly
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)
Randy Connolly
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)
Randy Connolly
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing Disciplines
Randy Connolly
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development Textbook
Randy Connolly
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
Randy Connolly
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"
Randy Connolly
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your Courses
Randy Connolly
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Randy Connolly
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbook
Randy Connolly
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Randy Connolly
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
Randy Connolly
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About Technology
Randy Connolly
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission data
Randy Connolly
 
Web Security
Web SecurityWeb Security
Web Security
Randy Connolly
 

More from Randy Connolly (20)

Celebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and DisciplinesCelebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and Disciplines
 
Public Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI CrisisPublic Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI Crisis
 
Why Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social SciencesWhy Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social Sciences
 
Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS Degree
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing Disciplines
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development Textbook
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your Courses
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbook
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About Technology
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission data
 
Web Security
Web SecurityWeb Security
Web Security
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 

ASP.NET 09 - ADO.NET

  • 1. Chapter 9 Using ADO.NET
  • 2.
  • 3.
  • 5.
  • 6.
  • 8. Abstract Base Classes of a Data Provider Class Description DbCommand Executes a data command, such as a SQL statement or a stored procedure. DbConnection Establishes a connection to a data source. DbDataAdapter Populates a DataSet from a data source. DbDataReader Represents a read-only, forward-only stream of data from a data source.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38. Programming a DbDataAdapter DataSet ds = new DataSet();   // create a connection SqlConnection conn = new SqlConnection(connString);   string sql = &quot;SELECT Isbn,Title,Price FROM Books&quot;; SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);   try { // read data into DataSet adapter.Fill(ds);   // use the filled DataSet } catch (Exception ex) { // process exception }
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48. Using Parameters <asp:DropDownList ID=&quot; drpPublisher &quot; runat=&quot;server&quot; DataSourceID=&quot;dsPublisher&quot; DataValueField=&quot;PublisherId&quot; DataTextField=&quot;PublisherName&quot; AutoPostBack=&quot;True&quot;/> … <asp:SqlDataSource ID=&quot;dsBooks&quot; runat=&quot;server&quot; ProviderName=&quot;System.Data.OleDb&quot; ConnectionString=&quot;<%$ ConnectionStrings:Catalog %>&quot; SelectCommand=&quot;SELECT ISBN, Title FROM Books WHERE PublisherId=@Pub &quot;>   <SelectParameters> <asp:ControlParameter ControlID=&quot;drpPublisher&quot; Name=&quot;Pub&quot; PropertyName=&quot;SelectedValue&quot; /> </SelectParameters> </asp:SqlDataSource>
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.