
Grabar registros en Base de Datos de Access 2010
Publicado por Fernando (25 intervenciones) el 14/06/2015 10:41:14
Hola amigos tengo un problema con este código y no se como resolverlo podriais ayudarme. Además de pasarlo al DataGrid quiero que se grabe en la base de datos pero me sale estos errores "Update successful" "Update failed" y no graba.
GRACIAS
GRACIAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Imports System.Data.SqlClient
Public Class Form2
Dim row(4) As String
Private Sub Form3_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'TODO: esta línea de código carga datos en la tabla 'HOTELESDataSet.CIUTADELLA' Puede moverla o quitarla según sea necesario.
Me.BARCINOableAdapter.Fill(Me.REPUESTOSDataSet.BAR CINO)
End Sub
Private Sub Guardar_Click(sender As System.Object, e As System.EventArgs) Handle Button2.Click
Dim fila As DataRow =
Me.REPUESTOSDataSet.BARCINO.NewRow()
'fila(0) = codigo autogenerado por lo tanto no lo asignamos
fila(1) = Me.TextBox4.Text 'Nombre de la categoria
fila(2) = Me.TextBox3.Text 'Nombre de la categoria
fila(3) = Me.TextBox2.Text 'Nombre de la categoria
fila(4) = Me.TextBox1.Text 'Nombre de la categoria
Me.REPUESTOSDataSet.BARCINO.Rows.Add(fila)
'Hasta aquí se agregaron los datos, pero sólo en el DATASET
TextBox4.Text = ""
TextBox3.Text = ""
TextBox2.Text = ""
TextBox1.Text = ""
'Actualizamos los cambios en la BD, metodo UPDATE
Me.BARCINOTableAdapter.Update(Me.REPUESTOSDataSet. BARCINO)
Me.Validate()
End Sub
Private Sub Modificar_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
End Sub
Valora esta pregunta


0