严重影响网页速度的代码,怎么优化
就是下面这段代码,我也不想叫它垃圾代码,因为是我自己写的,但现在看来确实像垃圾了,请高手看看优化
SqlConnection con = new SqlConnection("server=.\\sqlexpress;database=newcn8b004;uid=sa;pwd=1234");
SqlDataAdapter dr1 = new SqlDataAdapter("select * from taocan where tcxiaoqu='虹口小区'", con);
SqlDataAdapter dr2 = new SqlDataAdapter("select * from hztc", con);
SqlDataAdapter dr3 = new SqlDataAdapter("select * from mianshi", con);
SqlDataAdapter dr4 = new SqlDataAdapter("select * from shuijiao", con);
SqlDataAdapter dr5 = new SqlDataAdapter("select * from rouzhipin", con);
SqlDataAdapter dr6 = new SqlDataAdapter("select * from yinliao", con);
SqlDataAdapter dr7 = new SqlDataAdapter("select * from xiaochao", con);
SqlDataAdapter dr8 = new SqlDataAdapter("select * from hanbaobao", con);
SqlDataAdapter dr9 = new SqlDataAdapter("select * from Province", con);
SqlDataAdapter dr10 = new SqlDataAdapter("select * from City", con);
SqlDataAdapter dr11 = new SqlDataAdapter("select * from District", con);
SqlDataAdapter dr12 = new SqlDataAdapter("select * from xiaoqu where UnderDistrictName='芝罘区' ", con);
SqlDataAdapter dr13 = new SqlDataAdapter("select * from Street where UnderQuName='虹口小区' ", con);
SqlDataAdapter dr14 = new SqlDataAdapter("select * from newProduct", con);
SqlDataAdapter dr15 = new SqlDataAdapter("select * from other", con);
DataSet ds = new DataSet();
dr1.Fill(ds, "taocan");
dr2.Fill(ds, "hz");
dr3.Fill(ds, "mianshi");
dr4.Fill(ds, "shuijiao");
dr5.Fill(ds, "rouzhipin");
dr6.Fill(ds, "yinliao");
dr7.Fill(ds, "xiaochao");
dr8.Fill(ds, "hanbaobao");
dr9.Fill(ds, "sheng");
dr10.Fill(ds, "shi");
dr11.Fill(ds, "qu");
dr12.Fill(ds, "xiaoqu");
dr13.Fill(ds, "street");
dr14.Fill(ds, "new");
dr15.Fill(ds, "other");
this.rptProduct.DataSource = ds.Tables["taocan"].DefaultView;
this.Datalist1.DataSource = ds.Tables["hz"].DefaultView;
this.Datalist2.DataSource = ds.Tables["mianshi"].DefaultView;
this.Datalist3.DataSource = ds.Tables["shuijiao"].DefaultView;
this.Datalist4.DataSource = ds.Tables["rouzhipin"].DefaultView;
this.Datalist5.DataSource = ds.Tables["yinliao"].DefaultView;
this.Datalist6.DataSource = ds.Tables["xiaochao"].DefaultView;
this.Datalist7.DataSource = ds.Tables["hanbaobao"].DefaultView;
this.Datalist8.DataSource = ds.Tables["other"].DefaultView;
this.ddlProvince.DataSource = ds.Tables["sheng"].DefaultView;
this.ddlCity.DataSource = ds.Tables["shi"].DefaultView;
this.ddlArea.DataSource = ds.Tables["qu"].DefaultView;
this.ddlDeliveryArea.DataSource = ds.Tables["xiaoqu"].DefaultView;
this.ddlStreet.DataSource = ds.Tables["street"].DefaultView;
this.rptNewsProduct.DataSource = ds.Tables["new"].DefaultView;
this.ddlProvince.DataTextField = "ProvinceName";
this.ddlCity.DataTextField = "CityName";
this.ddlArea.DataTextField = "DistrictName";
this.ddlDeliveryArea.DataTextField = "QuName";
this.ddlStreet.DataTextField = "StreetName";
this.rptProduct.DataBind();
this.rptNewsProduct.DataBind();
this.Datalist1.DataBind();
this.Datalist2.DataBind();
this.Datalist3.DataBind();
this.Datalist4.DataBind();
this.Datalist5.DataBind();
this.Datalist6.DataBind();
this.Datalist7.DataBind();
this.Datalist8.DataBind();
this.ddlProvince.DataBind();
this.ddlCity.DataBind();
this.ddlArea.DataBind();
this.ddlDeliveryArea.DataBind();
this.ddlStreet.DataBind();