Hice lo siguiente:
Código:
Pero me da el siguiente error:Dim daRechazo As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("Select * from RechazoCheque", cnn) daRechazo.InsertCommand.CommandText = "Insert Into RechazoCheque (clCodigo,rtCodigo,rcMonto,rcFecha) values('01','01',50.0,'01/01/2004')"
Cita:
Cómo le hago para hacer un Insert? Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 59: Try
Line 60: Dim daRechazo As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("Select * from RechazoCheque", cnn)
Line 61: daRechazo.InsertCommand.CommandText = "Insert Into RechazoCheque (clCodigo,rtCodigo,rcMonto,rcFecha) values('01','01',50.0,'01/01/2004')"
Line 62:
Line 63: Response.Redirect("ChequeRechazadoGrabado.aspx")
Source File: C:\Joe\Desarrollo\Aplicaciones Web\Liquidacion\RechazarCheque.aspx.vb Line: 61
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 59: Try
Line 60: Dim daRechazo As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("Select * from RechazoCheque", cnn)
Line 61: daRechazo.InsertCommand.CommandText = "Insert Into RechazoCheque (clCodigo,rtCodigo,rcMonto,rcFecha) values('01','01',50.0,'01/01/2004')"
Line 62:
Line 63: Response.Redirect("ChequeRechazadoGrabado.aspx")
Source File: C:\Joe\Desarrollo\Aplicaciones Web\Liquidacion\RechazarCheque.aspx.vb Line: 61
