ado.net fundamentals
TRANSCRIPT
Chương: 15
ADO.NET Fundamentals
Lập trình Web Lập trình Web
1 Lập trình Web
Nội dungNội dungUnderstanding Data ManagementConfiguring Your DatabaseSQL BasicsADO.NET BasicsDirect Data AccessDisconnected Data Access
Lập trình Web 2
Understanding Data ManagementUnderstanding Data ManagementReference:
Beginning ASP.NET 3.5 in C sharp 2008 From Novice to Professional, 2nd edittion, Apress ( page 483 – 486)
Lập trình Web 3
Configuring Your Configuring Your DatabaseDatabaseSQL Server Express (SV tự đọc tài liệu)Browsing and Modifying Databases in Visual Studio ( SV tự đọc tài liệu)The sqlcmd Command-Line Tool
Lập trình Web4
The sqlcmd Command-Line ToolThe sqlcmd Command-Line ToolSqlcmd.exe is the tools that you can use to perform
database tasks from a Windows command prompt
The sqlcmd tool is installed as part of SQL Server 2005 (and 2008), and it’s found in a directory like c:\Program Files\Microsoft SQL Server\90\Tools\Binn
To see all the possible parameters, type this command:
Lập trình Web 5
sqlcmd -?
The sqlcmd Command-Line ToolThe sqlcmd Command-Line Tool
Lập trình Web 6
Example:Example:
Lập trình Web 7
sqlcmd -S .\Sqlexpress -U sa -P 123 -i BanSach.sql
SQL BasicsSQL BasicsRunning Queries in Visual StudioThe Select StatementThe SQL Update StatementThe SQL Insert StatementThe SQL Delete Statement
Lập trình Web8
ADO.NET BasicsADO.NET BasicsData NamespacesThe Data Provider Classes
Lập trình Web9
Data NamespacesData NamespacesNamespace Purpose
System.Data Contains fundamental classes with the core ADO.NET functionality. This includes DataSet and DataRelation,
System.Data.Common
Not used directly in your code. These classes are used by other data provider classes that inherit from them and provide versions customized for a specific data source.
System.Data.OleDb Contains the classes you use to connect to an OLE DB data source and execute commands,
Lập trình Web 10
Data NamespacesData NamespacesNamespace Purpose
System.Data.SqlClient
Contains the classes you use to connect to a Microsoft SQL Server database (version 7.0 or later) and execute commands.
System.Data.SqlTypes
Contains structures for SQL Server–specific data types such as SqlMoney and SqlDateTime.
System.Data.Odbc Contains the classes you use to connect to a data source through an ODBC driver and execute commands
Lập trình Web 11
The Data Provider ClassesThe Data Provider ClassesSQL Server DataProvider
OLE DB Data Provider
Oracle Data Provider
ODBC Data Provider
Connection SqlConnection OleDbConnection
OracleConnection
OdbcConnection
Command
DataReaderDataAdapter
Lập trình Web 12
Direct Data AccessDirect Data AccessCreating a ConnectionThe Select CommandThe DataReaderLab
Lập trình Web13
LabLabTạo trang quản lý thông tin Nhân viên ( xem, thêm, xóa,
sửa)
Lập trình Web 14
Disconnected Data AccessDisconnected Data Access
Lập trình Web15
The DataSet family of objectsThe DataSet family of objects
Lập trình Web 16
Selecting Disconnected DataSelecting Disconnected Data
Lập trình Web 17
Selecting Multiple TablesSelecting Multiple Tables
Lập trình Web 18
Defining RelationshipsDefining Relationships
Lập trình Web 19
LabLabTạo trang xem thông tin phân quyền nhân viên.
Lập trình Web 20