EJERCICIO EN VISUAL BASIC CONECTANDO A BASE DE DATOS
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cnn As New OleDb.OleDbConnection
Dim dt As New DataTable
Dim da As New OleDb.OleDbDataAdapter
Dim cmd As New OleDb.OleDbCommand
cnn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Wz\Documents\futbol.accdb; Persist Security info=false"
cnn.Open()
Dim sql As String
sql = " insert into jugadores(cedula,nombre,apodo,direccion,telefono)" &
" values ( '" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "' ,'" & TextBox4.Text & "','" & TextBox5.Text & "' ) "
Dim cdo As New OleDb.OleDbCommand(sql, cnn)
cdo.ExecuteNonQuery()
End Sub
End Class