protected void Button3_Click(object sender, EventArgs e) { hydropower ad = new hydropower(); DataSet abc = ad.GetAll(); GridView1.DataSource = abc; GridView1.DataBind(); }
protected void Button4_Click(object sender, EventArgs e) { string qq = "Data Source=gz-20150728tajv\\sqlexpress;Initial Catalog=Student1;Integrated Security=True "; SqlConnection Conn = new SqlConnection(qq); Conn.Open(); string SQL = "UPDATE Hydropower SET " + TextBox7.Text + "='" + TextBox8.Text + "' where 编号='" + TextBox6.Text + "'"; SqlCommand cmd = new SqlCommand(SQL, Conn); cmd.ExecuteNonQuery(); Conn.Close(); hydropower ad = new hydropower(); DataSet abc = ad.GetAll(); GridView1.DataSource = abc; GridView1.DataBind(); }