Ver Mensaje Individual
  #12 (permalink)  
Antiguo 03/10/2009, 07:29
Avatar de Peterpay
Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 16 años, 8 meses
Puntos: 87
Respuesta: Porque queda colgado?

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
.Update(CType(Me.MiEnlazadorMat.DataSource, DataTable))
End With

cmbMat.Text = txtMaterialesNuevoMat.Text
txtCostoMat.Text = txtCostoEditMat.Text
MiConexion.Open()
Dim Resultado = MiAdaptadorMat.InsertCommand.ExecuteNonQuery()
MiConexion.Close()
Call Cargar_datos() <----- COMENTALO o ELIMINALO

End Sub

quita el Call Cargar_datos() de este metodo lo estas invocando aqui pero tambien cuando la pagina haga response a tu peticion lo ejecutara porq se ejecuta en el Page_Load
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5