SlideShare a Scribd company logo
MYSQL.DATA.MYSQLCLIENT
ACTIVIDAD 1 UNIDAD 3
AL10518880
AGOSTO 2018
1. Ingresar al link
1. https://dev.mysql.com/doc/visual-studio/en/visual-studio-install.html
2. Verificar si nuestro equipo cuenta con los requisitos necesarios para
la ejecuciĂłn del conector.
3. Descargar del siguiente link el conector
1. https://dev.mysql.com/downloads/connector/net/1.0.html
4. Seleccionar la plataforma en que vamos a instalarlo
5. Damos click para guardar el archivo
6. Una vez descargado damos doble
click para comenzar con la instalaciĂłn
7. Damos click en next
8. Seleccionamos la instalaciĂłn tĂ­pica
9. ComenzarĂĄ la instalaciĂłn
10. Finalizar la instalaciĂłn
CLASES EN MYSQL CLIENT
NOMBRE SINTAXIS DESCRIPCION EJEMPLO
MySqlConnection
public sealed class MySqlConnection : DbConnection,
HACE REFERENCIA A UNA CONEXIÓN
UNICA CON LA BASE DE DATOS DE
MYSQL QUE SE UTILIZA EN
COMBINACION CON
MYSQLCOMMAND,
MYSQLDATAREADER,
MYSQLDATAADAPTER
public void InsertRow(string myConnectionString)
{
// If the connection string is null, use a default.
if(myConnectionString == "")
{
myConnectionString = "Database=Test;Data
Source=localhost;User Id=username;Password=pass";
}
MySqlConnection myConnection = new
MySqlConnection(myConnectionString);
string myInsertQuery = "INSERT INTO Orders (id, customerId,
amount) Values(1001, 23, 30.66)";
MySqlCommand myCommand = new
MySqlCommand(myInsertQuery);
myCommand.Connection = myConnection;
myConnection.Open();
myCommand.ExecuteNonQuery();
myCommand
Icloneable
MySQLConnection
NOMBRE SINTAXIS DESCRIPCION EJEMPLO
MySqlCommand public sealed class MySqlCommand : DbCommand,
ES UNA PARTE FUNDAMENTAL PARA ABRIR
UNA CONEXIÓN DE BASES DE DATOS YA
QUE ESTA CLASE RECIBE Y EJECUTA LAS
SENTENCIAS SQL Y LOS PARAMETROS
NECESARIOS PARA ESTABLECER LA
CONEXIÓN CON LA BASE DE DATOS
public void InsertRow(string myConnectionString)
{
// If the connection string is null, use a default.
if(myConnectionString == "")
{
myConnectionString = "Database=Test;Data Source=localhost;User
Id=username;Password=pass";
}
MySqlConnection myConnection = new
MySqlConnection(myConnectionString);
string myInsertQuery = "INSERT INTO Orders (id, customerId, amount)
Values(1001, 23, 30.66)";
MySqlCommand myCommand = new MySqlCommand(myInsertQuery);
myCommand.Connection = myConnection;
myConnection.Open();
myCommand.ExecuteNonQuery();
myCommand.Connection.Close();
}
MySqlCommand
NOMBRE SINTAXIS DESCRIPCION EJEMPLO
MySqlDataReader
public sealed class MySqlDataReader : DbDataReader,
IDataReader, IDisposable, IDataRecord
PARA CREAR UN MYSQLDATAREADER,
DEBE LLAMAR AL METODO
EXECUTEREADER DEL OBJETO
MYSQLCOMMAND, EN VEZ DE USAR
DIRECTAMENTE EL CONSTRUCTOR
MIENTRAS QUE EL
MYSQLDATAREADERESTA EN USO, EL
DEVART.DATA.MYSQLCONNECTION
ASOCIADO ESTA OCUPADO SIRVIENDO EL
MYSQLDATAREADER Y NO SE PUEDEN
REALIZAR OTRAS OPERACIONES EN EL
DEVART.DATA.MYSQL.MYSQLCONNECTIO
N QUE NO SEA CERRADO, ESTE ES EL
CASO HASTA QUE SE LLAMA AL METODO
CLOSE DEL MYSQLDATAREADER
public void ReadMyData(string myConnString) {
string mySelectQuery = "SELECT OrderID, CustomerID FROM Orders";
MySqlConnection myConnection = new MySqlConnection(myConnString);
MySqlCommand myCommand = new
MySqlCommand(mySelectQuery,myConnection);
myConnection.Open();
MySqlDataReader myReader;
myReader = myCommand.ExecuteReader();
// Always call Read before accessing data.
while (myReader.Read()) {
Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1));
}
// always call Close when done reading.
myReader.Close();
// Close the connection when done with it.
myConnection
MySqlDataReader
NOMBRE SINTAXIS DESCRIPCION EJEMPLO
MySqlDataAdapter
public sealed class MySqlDataAdapter : DbDataAdapter,
IDbDataAdapter, IDataAdapter
SIRVE COMO PUENTE ENTRE UN
CONJUNTO DE DATOS QUE SE
ENCUENTRAN EN LA BASE DE DATOS
PARA RECUPERAR Y GUARDAR DATOS. EL
MYSQDATAADAPTER
PROPORCIONAESTE PUESTE HACIENDO
USO DEL METODO FILL, QUE SIGNIFICA
AGREGA FILAS A DATASET
public DataSet SelectRows(DataSet dataset,string connection,string
query)
{
MySqlConnection conn = new MySqlConnection(connection);
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.SelectCommand = new MySqlCommand(query, conn);
adapter.Fill(dataset);
return dataset;
}
MySqlDataAdapter
NOMBRE SINTAXIS DESCRIPCION
BaseExceptionInterceptor
public abstract class BaseExceptionInterceptor
DESARROLLA UN INTERCEPTOR DE EXECIONES,
PRIMERO CREANDO UNA SUBCLASE DE LA
BASEEXCEPTIONINTERCEPTOR CLASE, DEBE ANULAR
EL INTERCEPEXCEPTION()METODO, TAMBIEN ANULA
EL INIT() METODO PARA REALIZAR ALGUNA
INICIALIZACION UNICA
BaseExceptionInterceptor
NOMBRE SINTAXIS DESCRIPCION
MySqlInfoMessageEventArgs Class
public class MySqlInfoMessageEventArgs : EventArgs
Determina si el Objeto especificado es igual al
Objeto actual.
(Heredado de Object )
MySqlInfoMessageEventArgs Class
Referencias
ORACLE. (2004). MySql.Data.MySqlClient Namespace. FEBRERO 2018, de ORACLE Sitio web:
https://dev.mysql.com/doc/dev/connector-net/6.10/html/N_MySql_Data_MySqlClient.htm
ORACLE. (2004). MySQL Documentation. FEBRERO 2018, de ORACLE Sitio web:
https://dev.mysql.com/doc/
Referencias

More Related Content

PPTX
Html5 websockets
PDF
Infinum Android Talks #17 - A quest for WebSockets by Zeljko Plesac
PDF
ASP.NET-Web Programming - Sessions and Cookies
PPTX
Workshop desarrollo Cassandra con el driver Java
PPTX
Pgp security mule
PPT
Struts2
PDF
Meteor Meets Mallory
PDF
Web security at Meteor (Pivotal Labs)
Html5 websockets
Infinum Android Talks #17 - A quest for WebSockets by Zeljko Plesac
ASP.NET-Web Programming - Sessions and Cookies
Workshop desarrollo Cassandra con el driver Java
Pgp security mule
Struts2
Meteor Meets Mallory
Web security at Meteor (Pivotal Labs)

What's hot (8)

PPTX
Cookie & Session In ASP.NET
PDF
Cookies in Angular | Install CookiesService
PDF
Difference Between ASP.NET 2.0 and ASP.NET 3.5
PDF
KSDG-iSlide App 開發心得分享
PPT
mysql-win.ppt
PPT
My SQl
PPTX
Java Course Day 24
PDF
Struts database access
Cookie & Session In ASP.NET
Cookies in Angular | Install CookiesService
Difference Between ASP.NET 2.0 and ASP.NET 3.5
KSDG-iSlide App 開發心得分享
mysql-win.ppt
My SQl
Java Course Day 24
Struts database access
Ad

Similar to Dprn3 u3 a1_ocov (20)

PPT
Mysql
PDF
Node.js with MySQL.pdf
PDF
Mvc acchitecture
PDF
Advanced Programming Using Visual Basic. NET
PDF
Cloud 101: Hands-on Heroku & AWS
PDF
Midwest PHP Presentation - New MSQL Features
DOCX
Simple ado program by visual studio
DOCX
Simple ado program by visual studio
DOCX
Learning MVC Part 3 Creating MVC Application with EntityFramework
PDF
Hdf installing-hdf
 
DOCX
LearningMVCWithLINQToSQL
DOCX
Repository Pattern in MVC3 Application with Entity Framework
PDF
C fowler azure-dojo
DOCX
Lovely
PDF
WP VERITAS InfoScale Storage and Dockers Intro - v8
PPTX
Scaling asp.net websites to millions of users
PPTX
The Azure API-ness Factory
PDF
From Zero to Cloud in 12 Easy Factors
PDF
New Flash Builder 4 WSDL and HTTP Connectors
PDF
Mysql connection
Mysql
Node.js with MySQL.pdf
Mvc acchitecture
Advanced Programming Using Visual Basic. NET
Cloud 101: Hands-on Heroku & AWS
Midwest PHP Presentation - New MSQL Features
Simple ado program by visual studio
Simple ado program by visual studio
Learning MVC Part 3 Creating MVC Application with EntityFramework
Hdf installing-hdf
 
LearningMVCWithLINQToSQL
Repository Pattern in MVC3 Application with Entity Framework
C fowler azure-dojo
Lovely
WP VERITAS InfoScale Storage and Dockers Intro - v8
Scaling asp.net websites to millions of users
The Azure API-ness Factory
From Zero to Cloud in 12 Easy Factors
New Flash Builder 4 WSDL and HTTP Connectors
Mysql connection
Ad

Recently uploaded (20)

PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
assetexplorer- product-overview - presentation
PPTX
Transform Your Business with a Software ERP System
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PPTX
L1 - Introduction to python Backend.pptx
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by AndrĂŠ Kraus
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
medical staffing services at VALiNTRY
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Advanced SystemCare Ultimate Crack + Portable (2025)
Designing Intelligence for the Shop Floor.pdf
Oracle Fusion HCM Cloud Demo for Beginners
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How to Choose the Right IT Partner for Your Business in Malaysia
Patient Appointment Booking in Odoo with online payment
Navsoft: AI-Powered Business Solutions & Custom Software Development
assetexplorer- product-overview - presentation
Transform Your Business with a Software ERP System
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
L1 - Introduction to python Backend.pptx
Salesforce Agentforce AI Implementation.pdf
17 Powerful Integrations Your Next-Gen MLM Software Needs
T3DD25 TYPO3 Content Blocks - Deep Dive by AndrĂŠ Kraus
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
medical staffing services at VALiNTRY
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM

Dprn3 u3 a1_ocov

  • 1. MYSQL.DATA.MYSQLCLIENT ACTIVIDAD 1 UNIDAD 3 AL10518880 AGOSTO 2018
  • 2. 1. Ingresar al link 1. https://dev.mysql.com/doc/visual-studio/en/visual-studio-install.html 2. Verificar si nuestro equipo cuenta con los requisitos necesarios para la ejecuciĂłn del conector. 3. Descargar del siguiente link el conector 1. https://dev.mysql.com/downloads/connector/net/1.0.html 4. Seleccionar la plataforma en que vamos a instalarlo
  • 3. 5. Damos click para guardar el archivo 6. Una vez descargado damos doble click para comenzar con la instalaciĂłn 7. Damos click en next
  • 4. 8. Seleccionamos la instalaciĂłn tĂ­pica 9. ComenzarĂĄ la instalaciĂłn 10. Finalizar la instalaciĂłn
  • 6. NOMBRE SINTAXIS DESCRIPCION EJEMPLO MySqlConnection public sealed class MySqlConnection : DbConnection, HACE REFERENCIA A UNA CONEXIÓN UNICA CON LA BASE DE DATOS DE MYSQL QUE SE UTILIZA EN COMBINACION CON MYSQLCOMMAND, MYSQLDATAREADER, MYSQLDATAADAPTER public void InsertRow(string myConnectionString) { // If the connection string is null, use a default. if(myConnectionString == "") { myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"; } MySqlConnection myConnection = new MySqlConnection(myConnectionString); string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"; MySqlCommand myCommand = new MySqlCommand(myInsertQuery); myCommand.Connection = myConnection; myConnection.Open(); myCommand.ExecuteNonQuery(); myCommand Icloneable MySQLConnection
  • 7. NOMBRE SINTAXIS DESCRIPCION EJEMPLO MySqlCommand public sealed class MySqlCommand : DbCommand, ES UNA PARTE FUNDAMENTAL PARA ABRIR UNA CONEXIÓN DE BASES DE DATOS YA QUE ESTA CLASE RECIBE Y EJECUTA LAS SENTENCIAS SQL Y LOS PARAMETROS NECESARIOS PARA ESTABLECER LA CONEXIÓN CON LA BASE DE DATOS public void InsertRow(string myConnectionString) { // If the connection string is null, use a default. if(myConnectionString == "") { myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"; } MySqlConnection myConnection = new MySqlConnection(myConnectionString); string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"; MySqlCommand myCommand = new MySqlCommand(myInsertQuery); myCommand.Connection = myConnection; myConnection.Open(); myCommand.ExecuteNonQuery(); myCommand.Connection.Close(); } MySqlCommand
  • 8. NOMBRE SINTAXIS DESCRIPCION EJEMPLO MySqlDataReader public sealed class MySqlDataReader : DbDataReader, IDataReader, IDisposable, IDataRecord PARA CREAR UN MYSQLDATAREADER, DEBE LLAMAR AL METODO EXECUTEREADER DEL OBJETO MYSQLCOMMAND, EN VEZ DE USAR DIRECTAMENTE EL CONSTRUCTOR MIENTRAS QUE EL MYSQLDATAREADERESTA EN USO, EL DEVART.DATA.MYSQLCONNECTION ASOCIADO ESTA OCUPADO SIRVIENDO EL MYSQLDATAREADER Y NO SE PUEDEN REALIZAR OTRAS OPERACIONES EN EL DEVART.DATA.MYSQL.MYSQLCONNECTIO N QUE NO SEA CERRADO, ESTE ES EL CASO HASTA QUE SE LLAMA AL METODO CLOSE DEL MYSQLDATAREADER public void ReadMyData(string myConnString) { string mySelectQuery = "SELECT OrderID, CustomerID FROM Orders"; MySqlConnection myConnection = new MySqlConnection(myConnString); MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection); myConnection.Open(); MySqlDataReader myReader; myReader = myCommand.ExecuteReader(); // Always call Read before accessing data. while (myReader.Read()) { Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1)); } // always call Close when done reading. myReader.Close(); // Close the connection when done with it. myConnection MySqlDataReader
  • 9. NOMBRE SINTAXIS DESCRIPCION EJEMPLO MySqlDataAdapter public sealed class MySqlDataAdapter : DbDataAdapter, IDbDataAdapter, IDataAdapter SIRVE COMO PUENTE ENTRE UN CONJUNTO DE DATOS QUE SE ENCUENTRAN EN LA BASE DE DATOS PARA RECUPERAR Y GUARDAR DATOS. EL MYSQDATAADAPTER PROPORCIONAESTE PUESTE HACIENDO USO DEL METODO FILL, QUE SIGNIFICA AGREGA FILAS A DATASET public DataSet SelectRows(DataSet dataset,string connection,string query) { MySqlConnection conn = new MySqlConnection(connection); MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = new MySqlCommand(query, conn); adapter.Fill(dataset); return dataset; } MySqlDataAdapter
  • 10. NOMBRE SINTAXIS DESCRIPCION BaseExceptionInterceptor public abstract class BaseExceptionInterceptor DESARROLLA UN INTERCEPTOR DE EXECIONES, PRIMERO CREANDO UNA SUBCLASE DE LA BASEEXCEPTIONINTERCEPTOR CLASE, DEBE ANULAR EL INTERCEPEXCEPTION()METODO, TAMBIEN ANULA EL INIT() METODO PARA REALIZAR ALGUNA INICIALIZACION UNICA BaseExceptionInterceptor NOMBRE SINTAXIS DESCRIPCION MySqlInfoMessageEventArgs Class public class MySqlInfoMessageEventArgs : EventArgs Determina si el Objeto especificado es igual al Objeto actual. (Heredado de Object ) MySqlInfoMessageEventArgs Class
  • 11. Referencias ORACLE. (2004). MySql.Data.MySqlClient Namespace. FEBRERO 2018, de ORACLE Sitio web: https://dev.mysql.com/doc/dev/connector-net/6.10/html/N_MySql_Data_MySqlClient.htm ORACLE. (2004). MySQL Documentation. FEBRERO 2018, de ORACLE Sitio web: https://dev.mysql.com/doc/ Referencias