Объект Command Свойства объекта Command Connection CommandText.

Slides:



Advertisements
Similar presentations
17. Data Access ADO.Net Architecture New Features of ADO.NET
Advertisements

ADO.Net Modelo para acesso a dados nas aplicação.Net Componentes: DataSet.Net Data providers: Connection Command DataReader DataAdapter.
Introduction to SQL, OleDB interface to Access from VB.NET.
Opret connection til database. Connectionstring setting.
ADO.NET: Working in Disconnected Environment Sergey Baidachni MCT, MCSD, MCDBA.
1 Interface IDbConnection ConnectionString defines data base connection Open and close connection Properties of connection object Creates Command-Object.
Direct Data Access, Data Binding. Content Direct Data Access Data Binding Muzaffer DOĞAN - Anadolu University2.
Adam Calderon – C# MVP Application Development Practice Lead InterKnowlogy.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Introduction to Database Processing with ADO.NET.
Coding ADO.NET Objects: Connection, Command, DataReader.
1 ADO.NET. 2.NET Framework Data Namespaces System.Data –Base set of classes and interfaces for ADO.NET System.Data.Common –Classes shared by the.NET Data.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
In C# program Before you can start using the ODBC class definitions, you will need to include the right module. using System.Data.Odbc; // ODBC definitions.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
CSci485 C# Lecture 1 - Antonios Daskos An Introduction to C# and Database Programming with ADO.NET Antonios Daskos.
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 ASP.NET ASP.NET Rina Zviel-Girshin Lecture 4. 2 Overview Data Binding Data Providers Data Connection Data Manipulations.
Developing Web Applications Using Microsoft ® Visual Studio ® 2008.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
PART 1 CREATING THE PRODUCT CATALOG. ROADMAP FOR THIS CHAPTER To implement the departments list, you’ll start with the database and make your way to the.
ADO.Net CS795. What is ADO.Net? Database language spoken by managed applications ADO.net database accesses go through modules: data providers –SQL Server.Net.
.NET Data Access and Manipulation ADO.NET. Overview What is ADO.NET? Disconnected vs. connected data access models ADO.NET Architecture ADO.NET Core Objects.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
 It is the primary data access model for.Net applications  Next version of ADO  Can be divided into two parts ◦ Providers ◦ DataSets  Resides in System.Data.
Module 2: Connecting to Data Sources. Overview Choosing a.NET Data Provider Defining a Connection Managing a Connection Handling Connection Exceptions.
Session 8: ADO.NET. Overview Overview of ADO.NET What is ADO.NET? Using Namespaces The ADO.NET Object Model What is a DataSet? Accessing Data with ADO.NET.
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.
1.Net programmingADO.NETNOEA / PQC ADO.NET Architecture Connection factory Config file DataReader DataSet DataGrid Autogeneration of SQL.
ADO.NET Part 2. Slide 2 Overview Slide 3 Introduction to the DataGridView Control It’s a two-dimensional grid containing rows and columns Its use in.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
An Introduction to ADO.Net Marmagna Desai.NET Seminar, Fall-2003.
Module 3: Performing Connected Database Operations.
ADO.NET Objects – Data Providers Dr. Ron Eaglin. Requirements Visual Studio 2005 Microsoft SQL Server 2000 or 2005 –Adventure Works Database Installed.
 It is the primary data access model for.Net applications  Next version of ADO  Can be divided into two parts ◦ Providers ◦ DataSets  Resides in System.Data.
1 11/10/05CS360 Windows Programming ADO.NET. 2 11/10/05CS360 Windows Programming ADO.NET  Behind every great application is a database manager o Amazon.
Why ADO.NET Not your father’s Data Access.
ADO.Net CS795. What is ADO.Net? Database language spoken by managed applications ADO.net database accesses go through modules: data providers –SQL Server.Net.
HNDIT Rapid Application Development
Databases – Unit 3 & 4.  SQL is not restricted to a specific database, however in class we will be looking at the two major database programmes in use.
Coding ADO.NET Objects: Connection, Command, DataReader.
Module 4 Introduction ADO.NET.
C# .NET Software Development
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 The SqlCommand Object ADO.NET - Lesson 03  Training time: 15 minutes  Author:
Data Access. ADO.NET ADO.NET is the primary library for building database solutions within the.NET Framework. ADO.NET does not replace ADO. ADO and OLEDB.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
.NET Data Access and Manipulation
Coding ADO.NET Objects: Connection, Command, DataReader.
Лекція 2. ОБ'ЄКТИ ADO. NET 1.З'єднання з базою даних 2.Командний рядок з'єднання ConnectionString 3.Поимилки з’єднання з БД 4.Пул інструкцій 5.Властивості.
C# MySQL onnect-C-to-MySQL 1.
 ADO.NET is an object-oriented set of libraries that allows you to interact with data sources  Commonly, the data source is a database, but it could.
ASP.NET Programming with C# and SQL Server First Edition
Data Access with ADO.NET
Introduction to Database Processing with ADO.NET
Coding ADO.NET Objects: Connection, Command, DataReader
Introduction to Database Processing with ADO.NET
ADO.NET and Stored Procedures
ADO.NET Framework.
PROG Advanced Web Apps 5/23/2018 Notes on ADO.NET (1) Wendi Jollymore, ACES.
Programming the Web Using ASP.Net
How to Create Login Form using vb.net and SqlServer Database
Lecture 6 VB.Net SQL Server.
Active Data Objects Binding ASP.NET Controls to Data
Unit 9.2 Database access from code Database Cycle Review
ADO.Net and Stored Procedures
Bài 5: ADO.NET 5.1. Khái niệm 5.2. Các lớp và không gian tên cơ bản của ADO.NET 5.3. Thao tác với dữ liệu kết nối – Connected 5.4. Thao tác với dữ liệu.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Active Data Objects Binding ASP.NET Controls to Data
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Introduction to Database Programming through ADO. NET
Presentation transcript:

Объект Command Свойства объекта Command Connection CommandText

OleDbConnection conn=new OleDbConnection(); conn.ConnectionString=ConnectionString; conn.Open(); OleDbCommand myCommand=new OleDbCommand(); myCommand.Connection = conn;

OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = ConnectionString; conn.Open(); OleDbCommand myCommand = conn.CreateCommand(); Метод CreateCommand

SELECT INSERT UPDATE DELETE

Методы объекта Command Cancel Clone CreateObjRef CreateCommand CreateParameter Dispose Equals ExecuteNonQuery ExecuteReader ExecuteScalar GetHashCode GetLifetimeService GetType InitializeLifetimeService Prepare ReferenceEquals ResetCommandTimeout ToString

Методы объекта Command (Для передачи свойства CommandText) ExecuteReader ExecuteScalar ExecuteNonQuery SELECT SELECT COUNT MIN MAX UPDATE INSERT DELETE DataReader SqlDataReader dataReader = myCommand.ExecuteReader();

Инструменты Visual Studio.NET для визуальной настройки объекта Command Свойство CommandType объекта sqlCommand

Параметризированные запросы Объект Parameter

myCommand.CommandText = "UPDATE Туристы SET Фамилия = 'Сергеева' WHERE Кодтуриста = 3"; ПРИМЕР 1. myCommand.CommandText = "UPDATE Туристы SET Фамилия = 'Какая-то_фамилия,_которую _введет_пользователь' WHERE Кодтуриста = Какой-то_код,_который _введет_пользователь"; myCommand.CommandText = "UPDATE Туристы SET Фамилия WHERE

Объект Connection

Свойства объекта Connection ConnectionString ConnectionTimeout Database DataSource PacketSize Provider ServerVersion State WorkstationId Provider (Поставщик) Connection Timeout или Connect Timeout (Время ожидания связи) Initial Catalog (Исходный каталог) Data Source (Источник данных) Password (Пароль) User ID (Пользовательский ID) Workstation ID Integrated Security или Trusted Connection (Интегрированная безопасность или Доверительное соединение) Persist Security Info (Удержание защитной информации

Методы объекта Connection BeginTransaction ChangeDatabase Close CreateCommand Open События объекта Connection StateChange InfoMessage