<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6489354678213391761</id><updated>2024-10-24T18:21:36.765-07:00</updated><title type='text'>Mr. Visual Basic Online</title><subtitle type='html'>Mr. Visual Basic Online, blog dedicado a la programación Visual Basic tan 6.0 y .Net</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mrvisualbasiconline.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://mrvisualbasiconline.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11054715576157561792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6489354678213391761.post-5578307698206032921</id><published>2012-07-14T23:13:00.000-07:00</published><updated>2012-07-15T06:53:03.304-07:00</updated><title type='text'>Ejemplo de código de ADO.Net</title><content type='html'>En esta entrada veremos como recuperar datos de una base de datos usando la&amp;nbsp;tecnología&amp;nbsp;ADO.Net. Los proveedores de datos de ADO.Net:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;NET Framework Data Provider para SQL Server (&lt;b&gt;System.Data.SqlClient&lt;/b&gt;)&lt;/li&gt;
&lt;li&gt;NET Framework para OLE DB (&lt;b&gt;System.Data.Oledb&lt;/b&gt;)&lt;/li&gt;
&lt;li&gt;NET Framework para ODBC (&lt;b&gt;System.Data.Odbc&lt;/b&gt;)&lt;/li&gt;
&lt;li&gt;NET Framework para Oracle (&lt;b&gt;System.Data.OracleClient&lt;/b&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;SqlClient&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
En este ejemplo nos conectaremos a la base de datos de prueba que viene con Microsoft SQL Server 7.0 &lt;b&gt;Northwind&lt;/b&gt;. En este código crearemos un object SqlCommand para seleccionar filas de la tabla Products, tambien la creación de un SqlParameter para limitar los resultados de las filas devueltas con un UniPrice mayor que el valor del parametro, crearemos un object SqlConnection para acceder a la base de datos, ejecutaremos el object SqlCommand y el resultado del object SqlCommand se lo pasaremos como valor a un object SqlDataReader para mostrar los datos.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Option Explicit On&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Option &lt;/span&gt;String &lt;span style=&quot;color: blue;&quot;&gt;On&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Imports&lt;/span&gt; System&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Imports &lt;/span&gt;System.Data&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Imports &lt;/span&gt;System.Data.SqlClient&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Public Class&lt;/span&gt; Program&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Public Share Sub&lt;/span&gt; Main()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;strConnection&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;As &lt;/span&gt;String = _&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #990000;&quot;&gt;&quot;Data Source=(Local);Initial Catalog=Northwind;&quot; &amp;nbsp;_&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; &quot;Integrated Security=true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Especificar la consulta con un parametro &#39;@PricePoint&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;strSQL &lt;span style=&quot;color: blue;&quot;&gt;As &lt;/span&gt;String =&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #990000;&quot;&gt;&quot;SELECT ProductID, UnitPrice, ProductName FROM Products &quot; _&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #990000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #990000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; &quot;WHERE UnitPrice &amp;gt; @PricePoint &quot; _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; &quot;ORDER BY UnitPrice DESC&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6aa84f; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;Especificar el valor de parametro&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; intParametroValue &lt;span style=&quot;color: blue;&quot;&gt;As &lt;/span&gt;Integer = 5&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Creando y abriendo la conexion usando un bloque &lt;b&gt;using&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Using &lt;/span&gt;Conn &lt;span style=&quot;color: blue;&quot;&gt;As New&lt;/span&gt; SqlConnection(strConnection&lt;span style=&quot;background-color: white;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Crear el Object SqlCommand y el object Parameter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Dim&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mmand&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;As&amp;nbsp;New&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SqlCommand(strSQL,Conn)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;command.Parameters.AddWithValue(&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&quot;@PricePoint&quot;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;,intParametroValue)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Abrimos la conexion dentro de un bloque Try/Catch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Try&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Conn.Open()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;dataReader &lt;span style=&quot;color: blue;&quot;&gt;As &lt;/span&gt;SqlDataReader = commando.ExecuteReader()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Do While&lt;/span&gt; dataReader.Read()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine( _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vbTab &amp;amp; &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;{0}&quot;&lt;/span&gt; &amp;amp; vbTab &amp;amp; &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;{1}&quot;&lt;/span&gt; &amp;amp; &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;{2}&quot;&lt;/span&gt;, _&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dataReader(0), dataReader(1), dataReader(2))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Loop&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;daraReader.Close()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Catch &lt;/span&gt;ex &lt;span style=&quot;color: blue;&quot;&gt;As &lt;/span&gt;Exception&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(ex.Message)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;End Try&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.ReadLine()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;End Using&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;End Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;End Class&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mrvisualbasiconline.blogspot.com/feeds/5578307698206032921/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/ejemplo-de-codigo-de-adonet.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/5578307698206032921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/5578307698206032921'/><link rel='alternate' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/ejemplo-de-codigo-de-adonet.html' title='Ejemplo de código de ADO.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11054715576157561792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6489354678213391761.post-9170490328629958356</id><published>2012-07-13T08:02:00.004-07:00</published><updated>2012-07-13T08:02:46.477-07:00</updated><title type='text'>Manual de Visual Basic .Net</title><content type='html'>Hola como estan todos aquí les traigo un Manual de Visual Basic .Net , descargar &lt;a href=&quot;http://www.4shared.com/office/UzuzJZgW/manual_de_visual_basic_net.html?&quot;&gt;aquí&amp;nbsp;&lt;/a&gt;&amp;nbsp;espero que le guste.</content><link rel='replies' type='application/atom+xml' href='http://mrvisualbasiconline.blogspot.com/feeds/9170490328629958356/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/manual-de-visual-basic-net.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/9170490328629958356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/9170490328629958356'/><link rel='alternate' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/manual-de-visual-basic-net.html' title='Manual de Visual Basic .Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11054715576157561792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6489354678213391761.post-1992877837122087851</id><published>2012-07-12T15:52:00.002-07:00</published><updated>2012-07-12T15:52:50.538-07:00</updated><title type='text'>Cómo usar el ADO datacontrol</title><content type='html'>Hola como están todos, aquí les traigo un ejemplo de como desarrollar una aplicación usan ADO Datacontrol, osea de forma visual. &lt;a href=&quot;http://www.elguille.info/vb/cursos_vb/basico/basico36.htm#ADOdatacontrol&quot;&gt;ver mas.&lt;/a&gt;&amp;nbsp;está fuente es de la página web&amp;nbsp;&lt;a href=&quot;http://www.elguille.info/&quot;&gt;http://www.elguille.info&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://mrvisualbasiconline.blogspot.com/feeds/1992877837122087851/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/como-usar-el-ado-datacontrol.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/1992877837122087851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/1992877837122087851'/><link rel='alternate' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/como-usar-el-ado-datacontrol.html' title='Cómo usar el ADO datacontrol'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11054715576157561792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6489354678213391761.post-4132398777027652292</id><published>2012-07-12T15:48:00.002-07:00</published><updated>2012-07-12T15:48:17.946-07:00</updated><title type='text'>Usar base de datos de SQL Server 2005 desde Visual Basic 6.0</title><content type='html'>Aquí les traigo una pequeña guía de como usar Microsoft SQL Server 2005 desde Visual basic 6.0 espero que le sea de su agrado, &amp;nbsp;&lt;a href=&quot;http://www.elguille.info/vb/bases/ADO/SQLServer2005_Visual_Basic_6.htm&quot;&gt;ver mas..&lt;/a&gt;&amp;nbsp;la fuente de este esta guia es de&amp;nbsp;&lt;a href=&quot;http://www.elguille.info/&quot;&gt;www.elguille.info&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://mrvisualbasiconline.blogspot.com/feeds/4132398777027652292/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/usar-base-de-datos-de-sql-server-2005.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/4132398777027652292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/4132398777027652292'/><link rel='alternate' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/usar-base-de-datos-de-sql-server-2005.html' title='Usar base de datos de SQL Server 2005 desde Visual Basic 6.0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11054715576157561792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6489354678213391761.post-5882132195281741342</id><published>2012-07-12T15:06:00.004-07:00</published><updated>2012-07-12T15:06:56.613-07:00</updated><title type='text'>Guía Práctica: ADO.Net para principiantes</title><content type='html'>Buenas como&amp;nbsp;están&amp;nbsp;todos para las personas que&amp;nbsp;están&amp;nbsp;interesados en aprender los&amp;nbsp;básico&amp;nbsp;de ADO.Net&amp;nbsp;aquí&amp;nbsp;les traigo una pequeña&amp;nbsp;guía. &lt;a href=&quot;http://www.elguille.info/colabora/NET2005/facund_ADONETGuiaPractica.htm&quot;&gt;Guí Práctica: ADO.Net para principiantes.&lt;/a&gt;&amp;nbsp;pagina oficial de este Link es&amp;nbsp;
&lt;a href=&quot;http://www.elguille.info/&quot;&gt;http://www.elguille.info&lt;/a&gt;&amp;nbsp;espero que le guste.</content><link rel='replies' type='application/atom+xml' href='http://mrvisualbasiconline.blogspot.com/feeds/5882132195281741342/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/guia-practica-adonet-para-principiantes.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/5882132195281741342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/5882132195281741342'/><link rel='alternate' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/guia-practica-adonet-para-principiantes.html' title='Guía Práctica: ADO.Net para principiantes'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11054715576157561792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6489354678213391761.post-4764567753061309184</id><published>2012-07-12T14:30:00.002-07:00</published><updated>2012-07-12T14:52:25.694-07:00</updated><title type='text'>Usando Parámetros con ADO - Visual Basic 6.0</title><content type='html'>Bueno&amp;nbsp;aquí&amp;nbsp;les traigo una breve explicación de como acceder a una base de datos mediante la tecnología ADO. &amp;nbsp;ADO nos ofrece dos objectos muy importantes como son el Objecto &lt;b&gt;Connection &lt;/b&gt;y el Objecto &lt;b&gt;Command&lt;/b&gt;, el primero de los mencionados anteriormente los permite establecer la conexión con el origen de datos, y el segundo nos permite de una forma u otra manipular los datos, a&amp;nbsp;través de consultas simples de SQL, Procedimientos Almacenados etc.&lt;br /&gt;
&lt;br /&gt;
Lo primero que tenemos que hacer&amp;nbsp;después&amp;nbsp;de haber abierto nuestro Microsoft Visual Basic 6.0 y elegir el tipo de proyecto que vamos a desarrollar, que para este ejemplo utilizaremos un proyecto&amp;nbsp;estándar, es ir al&amp;nbsp;Menú&amp;nbsp;&lt;b&gt;Proyecto &lt;/b&gt;-&amp;gt; &lt;b&gt;Referencias &lt;/b&gt;y elegir la opción &lt;b&gt;Microsoft ActiveX Data Object 2.8 Library &lt;/b&gt;&amp;nbsp;podemos elegir cualquier versión menos la 2.0.&lt;br /&gt;
&lt;br /&gt;
La aplicación de&amp;nbsp;tendrá&amp;nbsp;la siguiente apariencia:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLLimN_bpLm_Vf8Eo1W2be3Bt_izKQhmcEN5ajko4YX3X6noaM0415ZTCfDoRjVuiDfXl6IQBqymVA529gGyIkMODLHir-x8M15jYQfqv7u3qTWf12dw5rg0w3L02Fb-nMEidJlwwvv9w/s1600/Agenda.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;232&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLLimN_bpLm_Vf8Eo1W2be3Bt_izKQhmcEN5ajko4YX3X6noaM0415ZTCfDoRjVuiDfXl6IQBqymVA529gGyIkMODLHir-x8M15jYQfqv7u3qTWf12dw5rg0w3L02Fb-nMEidJlwwvv9w/s400/Agenda.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
#1: Primero declaramos dos variables una de tipo Connection y otra de Command en la parte general del formulario, como&amp;nbsp;sigue&amp;nbsp;a&amp;nbsp;continuación:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Option Explicit&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;Conn &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; ADODB.Connection&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Dim&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Cmd&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;As&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;ADODB.Commmand&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
#2: Segundo entramos al evento Load del formulario y creamos la siguiente sentencias:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt; Form_Load()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Nueva Connection&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;With&lt;/span&gt; Conn&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Provider = &quot;Microsoft.Jet.OLEDB.4.0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .ConnectionString = &quot;Data Source=&quot; &amp;amp; App.Path &amp;amp; &quot;\Agenda.mdb&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Open&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;End With&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
#3: Tercero en este paso programaremos el botón Guardar, y será de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt; cmdGuardar_Click()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Declaramos variables&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; strSQL &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; String&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Le asignamos la consulta SQL a la variable strSQL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; strSQL = &quot;INSERT INTO Contactos (codigo, nombre, apellidos, telefono, email) &quot; &amp;amp; _&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;VALUES (?,?,?,?,?)&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Nuevo Command&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Set &lt;/span&gt;CmdCont = &lt;span style=&quot;color: blue;&quot;&gt;New &lt;/span&gt;ADODB.Command&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;With &lt;/span&gt;CmdCont&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .ActiveConnection = Conn&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .CommandType = adCmdText&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .CommandText = strSQL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Prepared = &lt;span style=&quot;color: blue;&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;End With&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Creamos los parametros&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Codigo&quot;, adInteger, adParamInput, 2, txtCodigo.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Nombre&quot;, adVarChar, adParamInput, 30, txtNombre.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Apellidos&quot;, adVarChar, adParamInput, 40, txtApellidos.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Telefono&quot;, adVarChar, adParamInput, 12, txtTelefono.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Email&quot;, adVarChar, adParamInput, 60, txtEmail.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Ejecutamos el comando&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Execute&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
#4: Cuarto en este paso programaremos el botón Actualizar, y lo haremos de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt; cmdActualizar_Click()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Declaramos variables&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; strSQL &lt;span style=&quot;color: blue;&quot;&gt;As &lt;/span&gt;String&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Le asignamos la consulta SQL a la variable strSQL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; strSQL = &quot;UPDATE SET Contactos codigo = ?, nombre = ?, apellidos = ?, telefono = ?, email = ? &quot; &amp;amp; _&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;WHERE codigo = ?&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&#39;Nuevo Command&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Set &lt;/span&gt;CmdCont = &lt;span style=&quot;color: blue;&quot;&gt;New &lt;/span&gt;ADODB.Command&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;With &lt;/span&gt;CmdCont&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .ActiveConnection = Conn&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .CommandType = adCmdText&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .CommandText = strSQL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Prepared = &lt;span style=&quot;color: blue;&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;End With&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Creamos los parametros&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Codigo&quot;, adInteger, adParamInput, 2, txtCodigo.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Nombre&quot;, adVarChar, adParamInput, 30, txtNombre.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Apellidos&quot;, adVarChar, adParamInput, 40, txtApellidos.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Telefono&quot;, adVarChar, adParamInput, 12, txtTelefono.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Email&quot;, adVarChar, adParamInput, 60, txtEmail.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;FindCodigo&quot;, adInteger, adParamInput, 2, txtCodigo.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Ejecutamos el parametro&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Execute&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
#5: Quinto en este paso programaremos el botón Eliminar de la siguiente forma:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Private Sub&lt;/span&gt; cmdEliminar_Click()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Declaramos variables&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; strSQL &lt;span style=&quot;color: blue;&quot;&gt;As &lt;/span&gt;String&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Le asignamos la consulta SQL a la variable strSQL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; strSQL = &quot;DELETE FROM Conctactos WHERE codigo = ?&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Nuevo Command&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Set &lt;/span&gt;CmdCont = &lt;span style=&quot;color: blue;&quot;&gt;New &lt;/span&gt;ADODB.Command&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;With&lt;/span&gt; CmdCont&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .ActiveConnection = Conn&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .CommandType = adCmdText&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .CommandText = strSQL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Prepared = True&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;End With&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Creamos los parametros&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Parameters.Append CmdCont.CreateParameter(&quot;Codigo&quot;, adInteger, adParamInput, 2, txtCodigo.Text)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;&#39;Ejecutamos el parametro&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; CmdCont.Execute&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Bueno esto, se preguntarán que falta algunas parte por terminar, y la respuesta es SÍ!!, pero son parte simples que le corresponde a usted programarla como por ejemplo crear una procedimiento para limpiar las cajas de textos entre otras cosas.</content><link rel='replies' type='application/atom+xml' href='http://mrvisualbasiconline.blogspot.com/feeds/4764567753061309184/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/usando-parametros-con-ado-visual-basic_12.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/4764567753061309184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6489354678213391761/posts/default/4764567753061309184'/><link rel='alternate' type='text/html' href='http://mrvisualbasiconline.blogspot.com/2012/07/usando-parametros-con-ado-visual-basic_12.html' title='Usando Parámetros con ADO - Visual Basic 6.0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11054715576157561792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLLimN_bpLm_Vf8Eo1W2be3Bt_izKQhmcEN5ajko4YX3X6noaM0415ZTCfDoRjVuiDfXl6IQBqymVA529gGyIkMODLHir-x8M15jYQfqv7u3qTWf12dw5rg0w3L02Fb-nMEidJlwwvv9w/s72-c/Agenda.png" height="72" width="72"/><thr:total>1</thr:total></entry></feed>