首页 新闻 搜索 专区 学院

查找缺失图片的问题

0
悬赏园豆:20 [已关闭问题]

con.QueryString = "select ID,BigClassID,SmallClassID,BrandID,ProductName,TitleImage,PriceImage from product";
  SqlDataAdapter da = new SqlDataAdapter(con.QueryString, con.ConnectDB());
  DataSet ds = new DataSet();
  da.Fill(ds);
  DataTable dt = ds.Tables[0];
  for (int i = 0; i < dt.Rows.Count; i++)
  {
  TitleImages = dt.Rows[i]["TitleImage"].ToString();
  PicImages = dt.Rows[i]["PriceImage"].ToString();
  if (!File.Exists(Server.MapPath(TitleImages)))
  {
  con.QueryString = "selectID,BigClassID,SmallClassID,BrandID,ProductName from product whereTitleImage='" + TitleImages + "'";
  SqlDataAdapter com = new SqlDataAdapter(con.QueryString, con.ConnectDB());
  DataSet ds1 = new DataSet();
  com.Fill(ds1);
  this.Repeater2.DataSource = ds1;
  Repeater2.DataBind();
  string jswjdc = "" + System.DateTime.Today.Year.ToString() + "-" +System.DateTime.Today.Month.ToString() + "-" +System.DateTime.Today.Day.ToString();
  con.DataDownTOcsv(con.QueryString, jswjdc, "缺失图片产品表", "表名称:vwProduct", "编号,大类名称,小类名称,品牌名称,产品名称", 5);
  con.ConnectDB().Close();
  }

  if (!File.Exists(Server.MapPath(PicImages)))
  {
  con.QueryString = "selectID,BigClassID,SmallClassID,BrandID,ProductName from product wherePriceImage='" + PicImages + "'";
  SqlDataAdapter com = new SqlDataAdapter(con.QueryString, con.ConnectDB());
  DataSet ds1 = new DataSet();
  com.Fill(ds1);
  this.Repeater1.DataSource = ds1;
  Repeater1.DataBind();
  string jswjdc1 = "" + System.DateTime.Today.Year.ToString() + "-" +System.DateTime.Today.Month.ToString() + "-" +System.DateTime.Today.Day.ToString() + "-" +System.DateTime.Today.Hour.ToString();
  con.DataDownTOcsv(con.QueryString, jswjdc1, "缺失图片产品表", "表名称:vwProduct", "编号,大类名称,小类名称,品牌名称,产品名称", 5);
  con.ConnectDB().Close();
  }
   
  Response.Write(TitleImages);
  Response.Write(PicImages);
  }
我吧数据保存到EXCEL中 但只有一条数据啊 应该有两条的数据的

searchDM的主页 searchDM | 初学一级 | 园豆:160
提问于:2010-05-03 19:41
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册