Ver Mensaje Individual
  #3 (permalink)  
Antiguo 02/10/2009, 11:46
carlosanpy
 
Fecha de Ingreso: mayo-2009
Mensajes: 19
Antigüedad: 15 años
Puntos: 0
Respuesta: Porque queda colgado?

Hola gracias por responder

este es el codigo del boton



Private Sub toolMaterialGuardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles toolMaterialGuardar.Click

With MiAdaptadorMat
.InsertCommand = New System.Data.OleDb.OleDbCommand
.InsertCommand.Connection = MiConexion
.InsertCommand.CommandText = "INSERT INTO Precios(COS_DESCR,COS_COSTO,COS_UNIMED,COS_MONEDA, COS_FECHA,COS_MATMDO,COS_ACTUAL,COS_MEMO,COS_PROVE EDOR) VALUES (@material,@costo,@medida,@moneda,@fecha,@matmdo,@ actual,@memo,@proveedor)"
.InsertCommand.CommandType = System.Data.CommandType.Text
.InsertCommand.Parameters.Add("@material", OleDbType.VarChar).Value = txtMaterialesNuevoMat.Text
.InsertCommand.Parameters.Add("@costo", OleDbType.VarChar).Value = txtCostoEditMat.Text
.InsertCommand.Parameters.Add("@medida", OleDbType.VarChar).Value = cmbUnidadMat.Text
.InsertCommand.Parameters.Add("@moneda", OleDbType.VarChar).Value = txtMonedaMat.Text
.InsertCommand.Parameters.Add("@fecha", OleDbType.VarChar).Value = dateMat.Text
.InsertCommand.Parameters.Add("@matmdo", OleDbType.VarChar).Value = "MAT"
.InsertCommand.Parameters.Add("@actual", OleDbType.VarChar).Value = "N"
.InsertCommand.Parameters.Add("@memo", OleDbType.VarChar).Value = txtObservacionesEditMat.Text
.InsertCommand.Parameters.Add("@proveedor", OleDbType.VarChar).Value = txtProveedorEditMat.Text
End With

cmbMat.Text = txtMaterialesNuevoMat.Text
txtCostoMat.Text = txtCostoEditMat.Text
MiConexion.Open()
Dim Resultado = MiAdaptadorMat.InsertCommand.ExecuteNonQuery()
MiConexion.Close()

Call titulogrid()

End Sub