daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public Cliente ConsultarCliente(long? id)
  2.     {
  3.  
  4.         Cliente item;
  5.         DAL acessarBanco = new DAL(); // Instanciando objeto acessar banco para realizar a conex√£o de dados.
  6.         string sqlConsulta = $"Select ClienteId, Nome, CpfCnpj, Email, Senha From Estudo.Clientes Where ClienteId = '{ClienteId}' order by Nome asc"; //  variavel sqlConsulta para trazer todas os registros da tabela Clientes.
  7.         DataTable dt = acessarBanco.RetDataTable(sqlConsulta);
  8.  
  9.  
  10.  
  11.         item = new Cliente
  12.         {
  13.             ClienteId = dt.Rows[0]["ClienteId"].ToString(),
  14.             Nome = dt.Rows[0]["Nome"].ToString(),
  15.             CpfCnpj = dt.Rows[0]["CpfCnpj"].ToString(),
  16.             Email = dt.Rows[0]["Email"].ToString(),
  17.             Senha = dt.Rows[0]["Senha"].ToString()
  18.         };
  19.  
  20.         return item;
  21.     }
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