private void update_Click(object sender, EventArgs e) { UpdateProduct updateproduct = new UpdateProduct(); updateproduct.Owner = this; string goodsid = textBox1.Text; string SQLString = "select * from goodsInfo where goodsid=" + goodsid; SqlDataReader reader = goods_methods.ExecuteReader(SQLString); reader.Read(); string goodsid1 = reader.GetString(0); string goodsname = reader.GetString(1); string goodsprice = reader.GetSqlMoney(2).ToString(); string goodsphotoid = reader.GetString(3); reader.Close(); string SQLString1 = "select * from goodsphoto where goodsphotoid=" + goodsphotoid; SqlDataReader reader1 = goods_methods.ExecuteReader(SQLString1); reader1.Read(); string photourl = reader1.GetString(1); reader1.Close(); updateproduct.setValue(goodsid1, goodsname, goodsprice, goodsphotoid, photourl); updateproduct.ShowDialog(); }