public static void UpdateFileName()
{
EKA.EKAClient.MSSQLClient DB = new MSSQLClient("server=172.16.89.133;UID=sa;Pwd=888;Connection Reset=FALSE;DataBase=wap");
DataSet ds = DB.ExecuteQuery("select CID, CPicUrl from TRes");
int i = 100;
foreach (DataRow row in ds.Tables[0].Rows)
{
long cid = Convert.ToInt64(row["CID"]);
string cpicurl = Convert.ToString(row["CPicUrl"]);
string cpicfilename = System.IO.Path.GetFileName(cpicurl);
string sql = string.Format("update TRes set CPicFileName = '{0}' where CID = {1}", cpicfilename, cid);
DB.ExecuteNonQuery(sql);
System.Console.WriteLine(cid);
if (--i < 0)
{
i = 100;
Thread.Sleep(10);
}
}
DB.Close();
ds.Clear();
}
{
EKA.EKAClient.MSSQLClient DB = new MSSQLClient("server=172.16.89.133;UID=sa;Pwd=888;Connection Reset=FALSE;DataBase=wap");
DataSet ds = DB.ExecuteQuery("select CID, CPicUrl from TRes");
int i = 100;
foreach (DataRow row in ds.Tables[0].Rows)
{
long cid = Convert.ToInt64(row["CID"]);
string cpicurl = Convert.ToString(row["CPicUrl"]);
string cpicfilename = System.IO.Path.GetFileName(cpicurl);
string sql = string.Format("update TRes set CPicFileName = '{0}' where CID = {1}", cpicfilename, cid);
DB.ExecuteNonQuery(sql);
System.Console.WriteLine(cid);
if (--i < 0)
{
i = 100;
Thread.Sleep(10);
}
}
DB.Close();
ds.Clear();
}



博客
资料
短消息
搜索
加为好友
成为Fans
未选省份
