Public Class Form1
Private Sub Salir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Salir.Click
Dim msg As String
Dim titulo As String
Dim estilo As MsgBoxStyle
Dim res As MsgBoxResult
msg = "¿Desea Salir?" 'Define mensaje
estilo = MsgBoxStyle.DefaultButton2 Or _
MsgBoxStyle.Information Or MsgBoxStyle.YesNo
titulo = "BaseDatos" 'Define Titulo del msgbox
'despliega el mensaje
res = MsgBox(msg, estilo, titulo)
If res = MsgBoxResult.No Then
'accion a realizar
Else
End
End If
End Sub
Private Sub Agregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Agregar.Click
Dim mitabla As DataTable = DataSet11.Tabla
Dim cfilas As DataRowCollection = mitabla.Rows
Dim nuevafila As DataRow
Try
nuevafila = mitabla.NewRow
nuevafila(0) = txtid.Text
nuevafila(1) = txtnom.Text
nuevafila(2) = txtedad.Text
nuevafila(3) = txtdir.Text
cfilas.Add(nuevafila)
OleDbDataAdapter1.Update(DataSet11)
txtid.Focus()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'DataSet11.Clear()
'OleDbDataAdapter1.Fill(DataSet11)
End Sub
Private Sub Borrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Borrar.Click
Dim bmbase As BindingManagerBase = BindingContext(DataSet11, "Tabla")
Dim vistafilaactual As DataRowView
Dim nl As String = Environment.NewLine
If (MessageBox.Show("¿Desea Borrar El Dato?" & nl, "Buscar", MessageBoxButtons.YesNo, MessageBoxIcon.Information) = Windows.Forms.DialogResult.Yes) Then
vistafilaactual = bmbase.Current
vistafilaactual.Row.Delete()
End If
End Sub
End Class
No guarda los datos en la base de datos, me podrian decir cual es el error ?????
Ciento que no hay una instruccion....