Hola, tengo un problema y por mas vueltas que le doy no encuentro la solución, quiero añadir un registro a una tabla usando un DataAdapter y la propiedad InsertCommand:
Dim DA As New OleDb.OleDbDataAdapter
Dim SQL As String
SQL = "INSERT INTO Rutas (Nombre, Ciudad, Longitud) VALUES (@pn, @pc, @pl)"
Dim Cmd as New OleDb.OleDbCommand(SQL, CN)
Cmd.Parameters.AddWithValue("@pn", "Ruta 1")
Cmd.Parameters.AddWithValue("@pc", "Zamora")
Cmd.Parameters.AddWithValue("@pl", 1200)
DA.InsertCommand = Cmd
Bien, pues no hay manera de que me inserte el registro, algo falta o algo estoy haciendo mal... agradezco vuestra experta ayuda.
Gracias.
Dim DA As New OleDb.OleDbDataAdapter
Dim SQL As String
SQL = "INSERT INTO Rutas (Nombre, Ciudad, Longitud) VALUES (@pn, @pc, @pl)"
Dim Cmd as New OleDb.OleDbCommand(SQL, CN)
Cmd.Parameters.AddWithValue("@pn", "Ruta 1")
Cmd.Parameters.AddWithValue("@pc", "Zamora")
Cmd.Parameters.AddWithValue("@pl", 1200)
DA.InsertCommand = Cmd
Bien, pues no hay manera de que me inserte el registro, algo falta o algo estoy haciendo mal... agradezco vuestra experta ayuda.
Gracias.