title: Procedure broken when string has a number
body: <p>I have written this procedure in SQL Server:</p>
  
  <pre><code>ALTER proc [dbo].[cazacliente2]
      (@vbusca nvarchar(60), @bo int) 
  as
     if  @bo= 1  
     begin
        select idcliente, nome, endere, tel, pedido from Vw_Conscliente
        where  nome like @vbusca  
     end
  
     if @bo = 2
     begin 
        select idcliente, nome, endere, tel, pedido from Vw_Conscliente
        where endere like @vbusca 
     end
  
     if @bo = 3
     begin 
        select idcliente, nome, endere, tel, pedido from Vw_Conscliente
        where tel like  @vbusca  
     end
  
     if @bo = 4
     begin
        select idcliente, nome, endere, tel, pedido from Vw_Conscliente
        where pedido like @vbusca
     end
  </code></pre>
  
  <p>and this code in asp.net :</p>
  
  <pre><code>  {
          string valorC = "%" + TextBox1.Text + "%"; numo = DropDownList1.SelectedValue;
          string valorB = valorC.Replace(" ", "%"); 
  
          switch (numo)
          { 
              case "Nome":  num3 = 1;  break;     case "Endereço": num3 = 2; break ;
              case "Telefone": num3 = 3 ; break;  case "Pedido": num3 = 4; break ;
          }
  
          SqlCommand cmd = new SqlCommand();
          cmd.CommandType = CommandType.StoredProcedure;
          cmd.CommandText = "cazacliente2";
          SqlParameter valor = new SqlParameter("@vbusca", SqlDbType.NVarChar);
          SqlParameter num = new SqlParameter("@bo",SqlDbType.Int );
          valor.Value = valorB   ; num.Value = num3 ; 
          cmd.Parameters.Add(valor); cmd.Parameters.Add(num);
  
          if (conex1.State  == ConnectionState.Closed)
          {  conex1.Open(); }
              cmd.Connection = conex1;
          try
          {
              GridView1.EmptyDataText = "Nao se" + numo.ToString()  +"encontraron registros";
              GridView1.DataSource = cmd.ExecuteReader();
              GridView1.DataBind();
          }
          catch (Exception ex)
          { throw ex; }
          finally
          { conex1.Close(); }
  
      }
  </code></pre>
  
  <p>When I pass the string <code>afonso pena</code> the procedure returns all the data just fine, but when I pass in <code>afonso 60</code>, it returns an error, and when I pass a name that is not in the database it breaks again, it is like the part catch does not work.</p>