public void LoadOnlyLeadMasters() { try { DS_Main.Tables["LeadMasters"].Clear(); string query = "SELECT * FROM LeadMasters"; cmd = new OleDbCommand(query, con); cmd.ExecuteNonQuery(); adp = new OleDbDataAdapter(query, con); adp.Fill(DS_Main, "LeadMasters"); } catch (Exception E) { ErrorLog(E); } } public void DisplayingGridView() { Mainform = new Form1(Login); Mainform.LoadOnlyLeadMasters(); Display_dataGridView1.DataSource = Form1.DS_Main.Tables["LeadMasters"]; //Display_dataGridView1.DataMember = "LeadMasters"; for (int i = 0; i < Display_dataGridView1.Columns.Count; i++) { Display_dataGridView1.Columns[i].Visible = false; } Display_dataGridView1.Columns["CompanyName"].Visible = true; Display_dataGridView1.Columns["PersonName"].Visible = true; Display_dataGridView1.Columns["Number"].Visible = true; Display_dataGridView1.Columns["Emailaddress"].Visible = true; Display_dataGridView1.Columns["Product"].Visible = true; Display_dataGridView1.Refresh(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)