|
Level 1
INTRODUCTION TO ADO.NET
OVERVIEW
DATA ACCESS ARCHITECTURES
- Connected Environments
- Disconnected Environments
- Potential Data Stores
ADO.NET NAMESPACES
MOVING FROM ADO TO ADO.NET
SCENARIO
- Connected Scenario ?V Selecting Data
- Connected Scenario ?V Updating Data
- Disconnected Scenario ?V Selecting Data
- Resources
SUMMARY
Level 2
OVERVIEW
.NET DATA PROVIDERS
CONNECTION CLASS
- Properties
- Methods
- Events
CONNECTION STRINGS
- Popular Parameters
- Parameter Synonyms
- SQL Server Security
- Examples
MANAGING A CONNECTION
- Open
- Close & Dispose
- Exception Handling
- Implicitly Open and Close
CONNECTION POOLING
- What is Connection Pooling
- ConnectionString Settings
- Performance Monitor
- SQL Server Profiler
RESOURCES
Level 3
OVERVIEW
WHAT IS A COMMAND OBJECT?
- Encapsulates a SQL statement or stored procedure
- Properties
- Methods
EXECUTESCALAR
- Returns a single value (object)
COUNT, MAX, MIN, AVERAGE
EXECUTENONQUERY
DDL, DCL, DML
- Returns # of DML rows affected
EXECUTEREADER ?V RETURNS ROWS
EXECUTEXMLREADER
- SQL Server 2000 only
- Returns an XmlReader
COMMAND PARAMETERS
- SQL statements and SPs can have input, output, and return parameters
- Allow these parameters to be set/read
- Name, Type, Size, Direction
- Build them Programmatically
- Build them via Drag and Drop
- Setting Input Parameters
- Retrieving Output Parameters
- Stored Procedures
- Create with SQL Tools or Visual Studio
- CommandType
- Use Command Parameters
- TRANSACTIONS
- Set of related tasks that act as a unit
- Use SQL commands ?V BEGIN TRANS, COMMIT TRANS, ROLLBACK TRANS
- Or use Try ?V Catch and ADO.NET
SUMMARY
Level 4
RETRIEVING DATA
OVERVIEW
DATAREADER REVISITED
- Read-only, Forward-only stream
- ExecuteReader method returns
- Must "prime" the reader first
- HasRows, FieldCount, IsClosed
- Item indexer
- GetXXX methods, IsDbNull
- System.Data.SqlTypes
DATABINDING
- Cannot bind DataReader to Windows Forms Controls
- Can bind to Web Form Controls
- Q307860
GETSCHEMATABLE
- GetSchemaTable method
- Binding to a Windows DataGrid
RETRIEVING OUTPUT PARAMETERS
- Parameter must be Output or ReturnValue Direction
- DataReader must be closed
EXECUTING MULTIPLE STATEMENTS
- Stored Procedure or Batch may return multiple result sets
- NextResult method
SUMMARY
BUILDING DATASETS
OVERVIEW
DISCONNECTED ENVIRONMENT
DATASET OBJECT MODEL
- DataSet is an in-memory DB
- Tables collection
- Relations collection
DATAADAPTER
- Bridge between DataSet and the Data Source
- Represents a single result set/table
- Contains 4 Command Objects
- DataAdapter Object Model
FILLING THE DATASET
- DataAdapter's SelectCommand
- Execute SQL or a SP
DATASET SCHEMA
- Infer Schema & Constraints
- FillSchema
OPTIMIZING THE FILL
- Typed DataSets
- Set EnforceConstraints = False
- Call BeginLoadData method
SUMMARY
Level 5
OVERVIEW
BUILDING DATASETS
- Creating the pieces
- Column Properties
- Custom Expressions
ADDING CONSTRAINTS
- Primary Key
- Foreign Key Constraints
ADDING DATARELATIONS
SELECTING DATA
DATAVIEWS
STRONGLY TYPED DATASETS
SUMMARY
|