Ver Mensaje Individual
  #8 (permalink)  
Antiguo 23/01/2011, 21:55
Avatar de Dradi7
Dradi7
 
Fecha de Ingreso: junio-2008
Ubicación: Peru - Lima
Mensajes: 1.518
Antigüedad: 15 años, 10 meses
Puntos: 220
Respuesta: Pasar PArametros a un Store Procedure

pero si pruebas utilizando esto

Código C#:
Ver original
  1. private void buscarText(String texto){
  2.  
  3.          SqlConnection Con = new SqlConnection("tuconexion");
  4.          SqlCommand Com = new SqlCommand();
  5.          SqlDataAdapter Adp = new SqlDataAdapter();
  6.          DataTable Dt = new DataTable();
  7.          
  8.          Con.Open();
  9.          Com.Connection = Con;
  10.          Com.CommandType = CommandType.StoredProcedure;
  11.          Com.CommandText = "sp_Test";
  12.          Com.parameters.add(new SqlParamenter("@Numero",SqlDbType.NVarchar));
  13.          Com.parameters["@Numero"].value = texto;
  14.          Adp.SelectCommand = Com;
  15.          Adp.fill(Dt);
  16.          Con.Close();
  17.          tugrilla.DataSource = null;
  18.          tugrilla.rows.clear();
  19.          foreach(DataRow r in Dt.rows){
  20.                 Dt.rows.add(r.itemArray());
  21.          }
  22. }
  23.  
  24. // en tu boton solo llamarias
  25. buscarText(txtNumero.Text);
__________________
La clave de todo triunfador es eliminar todas sus excusas y sus limitaciones