Esempio n. 1
0
        public DataTable GetData()
        {
            DataTable dt = new DataTable();

            cmd.CommandText = "select *from tb_CTHD";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con.Connection;
            try
            {
                con.OpenConn();
                SqlDataAdapter sda = new SqlDataAdapter(cmd);
                sda.Fill(dt);
                con.CloseConn();
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();
                con.CloseConn();
            }
            return(dt);
        }