Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 59 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. List<int> listatel=new List<int>();
  2.         int tel = 0;
  3.         string usuario = "";
  4.  
  5.         SqlDataReader oReader;
  6.         SqlConnection cnn = new SqlConnection(CONEXION.STR);
  7.         SqlCommand cmd = new SqlCommand("AgregarTelCliente" , cnn);
  8.         cmd.CommandType = CommandType.StoredProcedure;
  9.         cmd.Parameters.AddWithValue("@usuario",pusuario);
  10.         cmd.Parameters.AddWithValue("@tel",telefono);
  11.  
  12.  
  13.  
  14.         SqlParameter oRetorno = new SqlParameter("@Retorno", SqlDbType.Int);
  15.         oRetorno.Direction = ParameterDirection.ReturnValue;
  16.         cmd.Parameters.Add(oRetorno);
  17.  
  18.  
  19.         try
  20.         {
  21.  
  22.             cnn.Open();
  23.             oReader = cmd.ExecuteReader();
  24.  
  25.            if (oReader.Read()) //cuando ejecuto paso a paso,no llega al if!
  26.             {
  27.  
  28.                 usuario = (string)oReader["usuario"];
  29.                 tel = (int)oReader["telefonos"];
  30.                 listatel.Add(tel);
  31.             }
  32.  
  33.         }
  34.         catch (Exception ex)
  35.         {
  36.             throw ex;
  37.         }
  38.         finally
  39.         {
  40.             cnn.Close();
  41.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top