ERROR : Excepción no controlada del tipo 'System.Data.OleDb.OleDbException' en system.data.dll

27/05/2005 - 20:29 por IDcom - Edison Rojas | Informe spam
ME EL SIGUENTE ERROR : Excepción no controlada del tipo
'System.Data.OleDb.OleDbException' en system.data.dll
EN LA LINEA ->Oleadatador.Update(Oledataset, "TABLA1")<-

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim Conectar As OleDb.OleDbConnection
Dim Oleadatador As OleDb.OleDbDataAdapter
Dim Oledataset As DataSet = New DataSet()
Conectar = New OleDb.OleDbConnection()
Conectar.ConnectionString = "Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=True;Initial Catalog=nuevas;Data
Source=PC1;Workstation ID=PC1;"
Conectar.Open()
Oleadatador = New OleDb.OleDbDataAdapter("select * from tabla1", Conectar)
Oleadatador.Fill(Oledataset, "tabla1")

Dim RegistroNuevo As DataRow = Oledataset.Tables("Tabla1").NewRow
RegistroNuevo("ID") = 6
RegistroNuevo("NOMBRE") = "CLAUDIO"
RegistroNuevo("VALOR") = 9
Oledataset.Tables("tabla1").Rows.Add(RegistroNuevo)
Dim comm As OleDb.OleDbCommand
comm = New OleDb.OleDbCommand()
comm.Connection = Conectar
comm.CommandText = "INSERT INTO TABLA1 (ID, NOMBRE, VALOR) VALUES (@ID,
@NOMBRE, @VALOR)"

comm.Parameters.Add("@ID", OleDbType.Numeric, 9, "ID")
comm.Parameters.Add("@NOMBRE", OleDbType.VarChar, 10, "NOMBRE")
comm.Parameters.Add("@VALOR", OleDbType.Decimal, 9, "VALOR")

Oleadatador.InsertCommand = comm
Oleadatador.Update(Oledataset, "TABLA1")
 

Leer las respuestas

#1 Marcos Mellibovsky
28/05/2005 - 14:43 | Informe spam
TEndrias que ver las propiedades del objeto exception para tener mas detalle


Saludos
Marcos Mellibovsky
MCAD - MCSD - MCSE - MCDBA
Cordoba - Argentina
"IDcom - Edison Rojas" escribió en el mensaje
news:uj$
ME EL SIGUENTE ERROR : Excepción no controlada del tipo
'System.Data.OleDb.OleDbException' en system.data.dll
EN LA LINEA ->Oleadatador.Update(Oledataset, "TABLA1")<-

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim Conectar As OleDb.OleDbConnection
Dim Oleadatador As OleDb.OleDbDataAdapter
Dim Oledataset As DataSet = New DataSet()
Conectar = New OleDb.OleDbConnection()
Conectar.ConnectionString = "Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=True;Initial Catalog=nuevas;Data
Source=PC1;Workstation ID=PC1;"
Conectar.Open()
Oleadatador = New OleDb.OleDbDataAdapter("select * from tabla1", Conectar)
Oleadatador.Fill(Oledataset, "tabla1")

Dim RegistroNuevo As DataRow = Oledataset.Tables("Tabla1").NewRow
RegistroNuevo("ID") = 6
RegistroNuevo("NOMBRE") = "CLAUDIO"
RegistroNuevo("VALOR") = 9
Oledataset.Tables("tabla1").Rows.Add(RegistroNuevo)
Dim comm As OleDb.OleDbCommand
comm = New OleDb.OleDbCommand()
comm.Connection = Conectar
comm.CommandText = "INSERT INTO TABLA1 (ID, NOMBRE, VALOR) VALUES (@ID,
@NOMBRE, @VALOR)"

comm.Parameters.Add("@ID", OleDbType.Numeric, 9, "ID")
comm.Parameters.Add("@NOMBRE", OleDbType.VarChar, 10, "NOMBRE")
comm.Parameters.Add("@VALOR", OleDbType.Decimal, 9, "VALOR")

Oleadatador.InsertCommand = comm
Oleadatador.Update(Oledataset, "TABLA1")



Preguntas similares