Example #1
0
        public DataTable ListarContacto()
        {
            conexion      cnn = new conexion();
            SqlConnection cn  = new SqlConnection(cnn.LeerConexion());
            SqlCommand    cmd = new SqlCommand("sp_tbContactoListar", cn);

            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable      tb = new DataTable();
                da.Fill(tb);
                return(tb);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                cn.Dispose();
                cmd.Dispose();
            }
        }