DataTable dt = DBHelper.RunProcTable("up_select_update");
if (dt != null && dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
string mobileid = dt.Rows[i]["mobile"].ToString();
string productId = dt.Rows[i]["productId"].ToString();
//循环取出数据 500条
try
{
//同步操作
lblText.Text = "正在同步....";
string url = " www.xxx.cn?mobileId=" + mobileid+"&productid="+productId;
Alex.Utility.HttpUtility.Get(System.Web.HttpUtility.HtmlEncode(url),Encoding.UTF8);
//成功了 +1 记录是哪个渠道号
}
catch(WebException e)
{
label2.Text = e.Message;
//失败了+记录是哪个渠道号
}
}
如上图 同步总数 = 成功数+失败数 每次运行程序读取500条数据 我不知道怎么统计成功数和失败数