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中 但只有一条数据啊 应该有两条的数据的