Imports System.Data.SqlClient
Public Class Form3
Dim k As New prueba
Dim bs As New BindingSource
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cargarDatos()
End Sub
Private Sub cargardatos()
bs.DataSource = k.llenar
BindingNavigator1.BindingSource = bs
DataGridView1.DataSource = bs
TextBox1.DataBindings.Clear()
TextBox2.DataBindings.Clear()
TextBox3.DataBindings.Clear()
TextBox4.DataBindings.Clear()
TextBox1.DataBindings.Add("text", bs, "nombre")
TextBox2.DataBindings.Add("text", bs, "comentarios")
TextBox3.DataBindings.Add("text", bs, "ruta")
TextBox4.DataBindings.Add("text", bs, "id")
cnn.Close()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
k.insertar(TextBox1.Text, TextBox2.Text, TextBox3.Text)
cargardatos()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
k.actualizandoDatos(TextBox1.Text, TextBox2.Text, TextBox3.Text, textbox4.text)
cargardatos()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
k.eliminarDatos(TextBox4.Text)
cargardatos()
End Sub
End Class