//==============================================================================================

        //private void Form1_onNewHome()
        //{
        //    ISynchronizeInvoke i = (ISynchronizeInvoke)this;
        //    if(i.InvokeRequired){
        //        newHome n = new newHome(Form1_onNewHome);
        //        i.BeginInvoke(n,null);
        //        return;
        //    }
        //    load();
        //    //throw new NotImplementedException();
        //}
        //private void load()
        //{
        //    DataTable dt = new DataTable();

        //    conn.Open();

        //    SqlCommand command = new SqlCommand("Select TOP 3 ID_BAN,TENBAN,STATUS from BAN ",conn);

        //    SqlDependency d = new SqlDependency(command);

        //    d.OnChange += d_OnChange;

        //    dt.Load(command.ExecuteReader(CommandBehavior.CloseConnection));
        //    //dt.Load(command.ExecuteReader());
        //    conn.Close();

        //    dtgv.DataSource = dt;

        //}

        //void d_OnChange(object sender, SqlNotificationEventArgs e)
        //{

        //    SqlDependency de = sender as SqlDependency;

        //    de.OnChange -=d_OnChange;

        //    if(onNewHome !=null){
        //        onNewHome();
        //    }
        //    //throw new NotImplementedException();
        //}



        //--------------------------------------------------------------------------------------



        //public DataTable ConvertToDataTable<T>(IList<T> data)
        //{
        //    PropertyDescriptorCollection properties =
        //       TypeDescriptor.GetProperties(typeof(T));
        //    DataTable table = new DataTable();
        //    foreach (PropertyDescriptor prop in properties)
        //        table.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);
        //    foreach (T item in data)
        //    {
        //        DataRow row = table.NewRow();
        //        foreach (PropertyDescriptor prop in properties)
        //            row[prop.Name] = prop.GetValue(item) ?? DBNull.Value;
        //        table.Rows.Add(row);
        //    }
        //    return table;

        //}


        public void loadData()
        {
            ConvertDataTable convert = new ConvertDataTable();

            dtgv.AutoGenerateColumns = false; // ko ra cột extension data

            dtgv.DataSource = convert.ToDataTable(webservice.getData());
        }