Wednesday, October 3, 2018

How to load data in datagridview or gridControl in C#

 private void LoadRecord()
        {
            string sql = "SELECT * FROM SaleInvoice";

            SqlDataAdapter dataadapter = new SqlDataAdapter(sql, con);
            DataSet ds = new DataSet();
            con.Open();
            dataadapter.Fill(ds, "Authors_table");
            con.Close();
            gridControl1.DataSource = ds;
            gridControl1.DataMember = "Authors_table";

        }

No comments:

Post a Comment