private void Form2_Load(object sender, EventArgs e) { dbConnection cn = new dbConnection(); cn.dbConnect(); string query = "select r_id,r_fname as'First Name',r_lname as'Last Name',r_cname as'Country Name',r_cityname as'City Name' from register"; da = new SqlDataAdapter(query, dbConnection.con); ds = new DataSet(); da.Fill(ds, "dgTable"); dgv.DataSource = ds.Tables[0]; dgv.Columns[0].Visible = false; }
private void Form1_Load(object sender, EventArgs e) { dbConnection cn = new dbConnection(); cn.dbConnect(); }