Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/07/2009, 06:51
megeduar
 
Fecha de Ingreso: junio-2007
Mensajes: 13
Antigüedad: 16 años, 10 meses
Puntos: 0
Respuesta: Problema con AddWithValue

Este es el codigo para insertar los valores en el stored procedure

public void InsertarTipo(object pid_Marca, object pModelo, string pNombreStoredProcedure)
{
this.cxn = new SqlConnection(this.cadenaConexion);
this.command = new SqlCommand();
this.adapter = new SqlDataAdapter();

this.cxn.Open();
this.command.Connection = this.cxn;
this.command.CommandType = System.Data.CommandType.StoredProcedure;
this.command.CommandText = pNombreStoredProcedure;
this.command.Parameters.AddWithValue("@id_Marca", pid_Marca);
this.command.Parameters.AddWithValue("@Modelo", pModelo);
this.command.Parameters.AddWithValue("@Potencia", pPotencia);
this.command.ExecuteNonQuery;

this.cxn.Close();
}