//从临时表取数存入数据集
cmd.CommandText = sSql;
dap.Fill(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString());
now = System.DateTime.Now;
if (DsHead.Tables[0].Rows.Count <= 0)//若主表没有数据,跳过本次循环
{
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,未生成json数据";
continue;
}
//否则计算通讯次数和最后一次通讯的条数
int iComCount=0; //通讯次数,若为36,则36/10=3
int iLastRowCount=0; //完成整数此通讯后剩余的数据条数,若为36,则36%10=6
int iMaxComCount = Convert.ToInt32( DsSendCfgHead.Tables[0].Rows[i]["MaxComNum"].ToString()); //从通讯设置表取的最大通讯条数
int iTblRowCount; //主表的待通讯条数
iTblRowCount = DsHead.Tables[0].Rows.Count;
iComCount = DsHead.Tables[0].Rows.Count / iMaxComCount;
iLastRowCount = DsHead.Tables[0].Rows.Count % iMaxComCount;
//重载注释:
//数据集转为JSON数组主表专用 iMaxCount-最大通讯条数 iCom-第几次通讯 iLast--最后一次通讯条数,不是最后一次通讯传入0
//DataSetToJson(DataSet ds, string tblname,int iMaxCount,int iCom,int iLast)
//若某个数组通讯失败,则把对应的数据从临时表删除,这样后续处理就不会处理这部分数据,下次通讯就可以再推了--我擦,有问题,没后续处理的没法办了,只能插错误表了
//
// *******************************************分组存入sJsonArr数组start*********************************************************
int iAryLength;//计算数组长度
if (iLastRowCount == 0)
{
iAryLength = iComCount;
}
else
{
iAryLength = iComCount+1;
}
string[] sJsonArr = new string[iAryLength];//视声明数组,长度为计算出来的长度
for (int x = 0; x < iComCount;x++ )//若为36,则X最大值为2,最小值为0
{
sJsonArr[x] = DataSetToJson(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString(), iMaxComCount, x, 0);
sJsonArr[x] = sJsonArr[x].Remove(sJsonArr[x].Length - 1, 1) + ",";//调整JSON格式,去掉大括号,拼上逗号
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,第" + x.ToString() + "次,已生成json数据" + iMaxComCount.ToString() + "条";
//开始拼从表数据
sSql = "Select * From tLyInterfaceSendCfg Where IsActive='1' and IsBody='1' And HeadTbl='" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "'";
cmd.CommandText = sSql;
DsSendCfgBody.Clear();
dap.Fill(DsSendCfgBody, "SendCfgBody");
for (int j = 0; j < DsSendCfgBody.Tables[0].Rows.Count; j++)
{
//取出本次主表中的关联字段
string sRelationColName=DsSendCfgBody.Tables[0].Rows[j]["RelationCol"].ToString();
string sInArr = "";//存IN语句的变量
for (int z = x * iMaxComCount; z < (x + 1) * iMaxComCount; z++)
{
sInArr = sInArr + "'" + DsHead.Tables[0].Rows[z][sRelationColName].ToString() + "',";
}
sInArr = " In (" + sInArr.Remove(sInArr.Length - 1, 1) + ")";
//下面是取从表的SQL语句了
sSql = DsSendCfgBody.Tables[0].Rows[j]["QuerySql"].ToString();
if (sInArr!="")
{
sSql = sSql + " And " + sRelationColName + sInArr;
}
cmd.CommandText = sSql;
DsBody.Tables.Clear();//清空所有表
dap.Fill(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString());
now = System.DateTime.Now;
if (DsBody.Tables[0].Rows.Count <= 0)//若从表没数据,就不再拼JSON
{
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + x.ToString() + "次,未生成json数据";
continue;
}
//调整从表json格式,左侧去掉{,右侧也去掉}再加上逗号
sJsonArr[x] = sJsonArr[x] + DataSetToJson(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString()).Remove(0, 1);
sJsonArr[x] = sJsonArr[x].Remove(sJsonArr[x].Length - 1, 1) + ",";
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + x.ToString() + "次,已生成json数据" + DsBody.Tables[0].Rows.Count + "条";
}
if (sJsonArr[x] != "")
{
sJsonArr[x] = sJsonArr[x].Remove(sJsonArr[x].Length - 1, 1) + "}";//拼上最后一个大括号
sJsonArr[x] = sJsonArr[x].Replace((char)10, '&').Replace((char)13, '&');//去掉回车符改为<br>
sJsonArr[x] = sJsonArr[x].Replace("&", "<br>");
}
//从表数据拼完
}
if (iLastRowCount!=0) //不为0说明还有几条不满的没拼进去
{
sJsonArr[iComCount] = DataSetToJson(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString(), iMaxComCount, iComCount, iLastRowCount);
sJsonArr[iComCount] = sJsonArr[iComCount].Remove(sJsonArr[iComCount].Length - 1, 1) + ",";//调整JSON格式,去掉大括号,拼上逗号
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,第" + iComCount.ToString() + "次,已生成json数据" + iLastRowCount.ToString() + "条";
//开始拼从表数据 iMaxCount * iCom
sSql = "Select * From tLyInterfaceSendCfg Where IsActive='1' and IsBody='1' And HeadTbl='" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "'";
cmd.CommandText = sSql;
DsSendCfgBody.Clear();
dap.Fill(DsSendCfgBody, "SendCfgBody");
for (int j = 0; j < DsSendCfgBody.Tables[0].Rows.Count; j++)
{
//取出本从表与主表的关联字段
string sRelationColName = DsSendCfgBody.Tables[0].Rows[j]["RelationCol"].ToString();
string sInArr = "";//存IN语句的变量
for (int z = iMaxComCount * iComCount ; z < iMaxComCount * iComCount + iLastRowCount; z++)
{
sInArr = sInArr + "'" + DsHead.Tables[0].Rows[z][sRelationColName].ToString() + "',";
}
sInArr = " In (" + sInArr.Remove(sInArr.Length - 1, 1) + ")";
//下面是取从表的SQL语句了
sSql = DsSendCfgBody.Tables[0].Rows[j]["QuerySql"].ToString();
if (sInArr != "")
{
sSql = sSql + " And " + sRelationColName + sInArr;
}
cmd.CommandText = sSql;
DsBody.Tables.Clear();//清空所有表
dap.Fill(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString());
now = System.DateTime.Now;
if (DsBody.Tables[0].Rows.Count <= 0)//若从表没数据,就不再拼JSON
{
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + iComCount.ToString() + "次,未生成json数据";
continue;
}
//调整从表json格式,左侧去掉{,右侧也去掉}再加上逗号
sJsonArr[iComCount] = sJsonArr[iComCount] + DataSetToJson(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString()).Remove(0, 1);
sJsonArr[iComCount] = sJsonArr[iComCount].Remove(sJsonArr[iComCount].Length - 1, 1) + ",";
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + iComCount.ToString() + "次,已生成json数据" + DsBody.Tables[0].Rows.Count + "条";
}
if (sJsonArr[iComCount] != "")
{
sJsonArr[iComCount] = sJsonArr[iComCount].Remove(sJsonArr[iComCount].Length - 1, 1) + "}";//拼上最后一个大括号
sJsonArr[iComCount] = sJsonArr[iComCount].Replace((char)10, '&').Replace((char)13, '&');//去掉回车符改为<br>
sJsonArr[iComCount] = sJsonArr[iComCount].Replace("&", "<br>");
}
//从表数据拼完
}
//至此,主从表数据都按最大通讯条数存进数组sJsonArr了
//**********************************************分组存入sJsonArr数据end******************************************************
//*****************原拼接JSON语句START,下面的句子是完整有效的,只是没有数据量控制**************************
//string sJson = "";
若有主表数据,则存入JSON--肯定有数据啦,没有在上面就跳出去了
//sJson = sJson + DataSetToJson(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString());
//textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,已生成json数据" + DsHead.Tables[0].Rows.Count + "条";
调整JSON格式,去掉大括号,拼上逗号
//if (sJson != "")
//{
// sJson = sJson.Remove(sJson.Length - 1, 1) + ",";
//}
接下来用循环拼从表的
//sSql = "Select * From tLyInterfaceSendCfg Where IsActive='1' and IsBody='1' And HeadTbl='" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "'";
//cmd.CommandText = sSql;
//DsSendCfgBody.Clear();
//dap.Fill(DsSendCfgBody, "SendCfgBody");
//for (int j = 0; j < DsSendCfgBody.Tables[0].Rows.Count; j++)
//{
// sSql = DsSendCfgBody.Tables[0].Rows[j]["QuerySql"].ToString();
// cmd.CommandText = sSql;
// DsBody.Tables.Clear();//清空所有表
// dap.Fill(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString());
// now = System.DateTime.Now;
// if (DsBody.Tables[0].Rows.Count <= 0)//若从表没数据,就不再拼JSON
// {
// textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,未生成json数据";
// continue;
// }
// //调整从表json格式,左侧去掉{,右侧也去掉}再加上逗号
// sJson = sJson + DataSetToJson(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString()).Remove(0, 1);
// sJson = sJson.Remove(sJson.Length - 1, 1) + ",";
// textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,已生成json数据" + DsBody.Tables[0].Rows.Count + "条";
//}
//if (sJson != "")
//{
// sJson = sJson.Remove(sJson.Length - 1, 1) + "}";//拼上最后一个大括号
// sJson = sJson.Replace((char)10, '&').Replace((char)13, '&');
// sJson = sJson.Replace("&", "<br>");
//}
//****************原拼接JSON语句End,可取消上述注释,用于验证通讯数量正确***************************************
cmd.CommandText = sSql;
dap.Fill(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString());
now = System.DateTime.Now;
if (DsHead.Tables[0].Rows.Count <= 0)//若主表没有数据,跳过本次循环
{
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,未生成json数据";
continue;
}
//否则计算通讯次数和最后一次通讯的条数
int iComCount=0; //通讯次数,若为36,则36/10=3
int iLastRowCount=0; //完成整数此通讯后剩余的数据条数,若为36,则36%10=6
int iMaxComCount = Convert.ToInt32( DsSendCfgHead.Tables[0].Rows[i]["MaxComNum"].ToString()); //从通讯设置表取的最大通讯条数
int iTblRowCount; //主表的待通讯条数
iTblRowCount = DsHead.Tables[0].Rows.Count;
iComCount = DsHead.Tables[0].Rows.Count / iMaxComCount;
iLastRowCount = DsHead.Tables[0].Rows.Count % iMaxComCount;
//重载注释:
//数据集转为JSON数组主表专用 iMaxCount-最大通讯条数 iCom-第几次通讯 iLast--最后一次通讯条数,不是最后一次通讯传入0
//DataSetToJson(DataSet ds, string tblname,int iMaxCount,int iCom,int iLast)
//若某个数组通讯失败,则把对应的数据从临时表删除,这样后续处理就不会处理这部分数据,下次通讯就可以再推了--我擦,有问题,没后续处理的没法办了,只能插错误表了
//
// *******************************************分组存入sJsonArr数组start*********************************************************
int iAryLength;//计算数组长度
if (iLastRowCount == 0)
{
iAryLength = iComCount;
}
else
{
iAryLength = iComCount+1;
}
string[] sJsonArr = new string[iAryLength];//视声明数组,长度为计算出来的长度
for (int x = 0; x < iComCount;x++ )//若为36,则X最大值为2,最小值为0
{
sJsonArr[x] = DataSetToJson(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString(), iMaxComCount, x, 0);
sJsonArr[x] = sJsonArr[x].Remove(sJsonArr[x].Length - 1, 1) + ",";//调整JSON格式,去掉大括号,拼上逗号
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,第" + x.ToString() + "次,已生成json数据" + iMaxComCount.ToString() + "条";
//开始拼从表数据
sSql = "Select * From tLyInterfaceSendCfg Where IsActive='1' and IsBody='1' And HeadTbl='" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "'";
cmd.CommandText = sSql;
DsSendCfgBody.Clear();
dap.Fill(DsSendCfgBody, "SendCfgBody");
for (int j = 0; j < DsSendCfgBody.Tables[0].Rows.Count; j++)
{
//取出本次主表中的关联字段
string sRelationColName=DsSendCfgBody.Tables[0].Rows[j]["RelationCol"].ToString();
string sInArr = "";//存IN语句的变量
for (int z = x * iMaxComCount; z < (x + 1) * iMaxComCount; z++)
{
sInArr = sInArr + "'" + DsHead.Tables[0].Rows[z][sRelationColName].ToString() + "',";
}
sInArr = " In (" + sInArr.Remove(sInArr.Length - 1, 1) + ")";
//下面是取从表的SQL语句了
sSql = DsSendCfgBody.Tables[0].Rows[j]["QuerySql"].ToString();
if (sInArr!="")
{
sSql = sSql + " And " + sRelationColName + sInArr;
}
cmd.CommandText = sSql;
DsBody.Tables.Clear();//清空所有表
dap.Fill(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString());
now = System.DateTime.Now;
if (DsBody.Tables[0].Rows.Count <= 0)//若从表没数据,就不再拼JSON
{
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + x.ToString() + "次,未生成json数据";
continue;
}
//调整从表json格式,左侧去掉{,右侧也去掉}再加上逗号
sJsonArr[x] = sJsonArr[x] + DataSetToJson(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString()).Remove(0, 1);
sJsonArr[x] = sJsonArr[x].Remove(sJsonArr[x].Length - 1, 1) + ",";
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + x.ToString() + "次,已生成json数据" + DsBody.Tables[0].Rows.Count + "条";
}
if (sJsonArr[x] != "")
{
sJsonArr[x] = sJsonArr[x].Remove(sJsonArr[x].Length - 1, 1) + "}";//拼上最后一个大括号
sJsonArr[x] = sJsonArr[x].Replace((char)10, '&').Replace((char)13, '&');//去掉回车符改为<br>
sJsonArr[x] = sJsonArr[x].Replace("&", "<br>");
}
//从表数据拼完
}
if (iLastRowCount!=0) //不为0说明还有几条不满的没拼进去
{
sJsonArr[iComCount] = DataSetToJson(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString(), iMaxComCount, iComCount, iLastRowCount);
sJsonArr[iComCount] = sJsonArr[iComCount].Remove(sJsonArr[iComCount].Length - 1, 1) + ",";//调整JSON格式,去掉大括号,拼上逗号
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,第" + iComCount.ToString() + "次,已生成json数据" + iLastRowCount.ToString() + "条";
//开始拼从表数据 iMaxCount * iCom
sSql = "Select * From tLyInterfaceSendCfg Where IsActive='1' and IsBody='1' And HeadTbl='" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "'";
cmd.CommandText = sSql;
DsSendCfgBody.Clear();
dap.Fill(DsSendCfgBody, "SendCfgBody");
for (int j = 0; j < DsSendCfgBody.Tables[0].Rows.Count; j++)
{
//取出本从表与主表的关联字段
string sRelationColName = DsSendCfgBody.Tables[0].Rows[j]["RelationCol"].ToString();
string sInArr = "";//存IN语句的变量
for (int z = iMaxComCount * iComCount ; z < iMaxComCount * iComCount + iLastRowCount; z++)
{
sInArr = sInArr + "'" + DsHead.Tables[0].Rows[z][sRelationColName].ToString() + "',";
}
sInArr = " In (" + sInArr.Remove(sInArr.Length - 1, 1) + ")";
//下面是取从表的SQL语句了
sSql = DsSendCfgBody.Tables[0].Rows[j]["QuerySql"].ToString();
if (sInArr != "")
{
sSql = sSql + " And " + sRelationColName + sInArr;
}
cmd.CommandText = sSql;
DsBody.Tables.Clear();//清空所有表
dap.Fill(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString());
now = System.DateTime.Now;
if (DsBody.Tables[0].Rows.Count <= 0)//若从表没数据,就不再拼JSON
{
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + iComCount.ToString() + "次,未生成json数据";
continue;
}
//调整从表json格式,左侧去掉{,右侧也去掉}再加上逗号
sJsonArr[iComCount] = sJsonArr[iComCount] + DataSetToJson(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString()).Remove(0, 1);
sJsonArr[iComCount] = sJsonArr[iComCount].Remove(sJsonArr[iComCount].Length - 1, 1) + ",";
textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 分组通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,第" + iComCount.ToString() + "次,已生成json数据" + DsBody.Tables[0].Rows.Count + "条";
}
if (sJsonArr[iComCount] != "")
{
sJsonArr[iComCount] = sJsonArr[iComCount].Remove(sJsonArr[iComCount].Length - 1, 1) + "}";//拼上最后一个大括号
sJsonArr[iComCount] = sJsonArr[iComCount].Replace((char)10, '&').Replace((char)13, '&');//去掉回车符改为<br>
sJsonArr[iComCount] = sJsonArr[iComCount].Replace("&", "<br>");
}
//从表数据拼完
}
//至此,主从表数据都按最大通讯条数存进数组sJsonArr了
//**********************************************分组存入sJsonArr数据end******************************************************
//*****************原拼接JSON语句START,下面的句子是完整有效的,只是没有数据量控制**************************
//string sJson = "";
若有主表数据,则存入JSON--肯定有数据啦,没有在上面就跳出去了
//sJson = sJson + DataSetToJson(DsHead, DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString());
//textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "表,已生成json数据" + DsHead.Tables[0].Rows.Count + "条";
调整JSON格式,去掉大括号,拼上逗号
//if (sJson != "")
//{
// sJson = sJson.Remove(sJson.Length - 1, 1) + ",";
//}
接下来用循环拼从表的
//sSql = "Select * From tLyInterfaceSendCfg Where IsActive='1' and IsBody='1' And HeadTbl='" + DsSendCfgHead.Tables[0].Rows[i]["TblName"].ToString() + "'";
//cmd.CommandText = sSql;
//DsSendCfgBody.Clear();
//dap.Fill(DsSendCfgBody, "SendCfgBody");
//for (int j = 0; j < DsSendCfgBody.Tables[0].Rows.Count; j++)
//{
// sSql = DsSendCfgBody.Tables[0].Rows[j]["QuerySql"].ToString();
// cmd.CommandText = sSql;
// DsBody.Tables.Clear();//清空所有表
// dap.Fill(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString());
// now = System.DateTime.Now;
// if (DsBody.Tables[0].Rows.Count <= 0)//若从表没数据,就不再拼JSON
// {
// textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,未生成json数据";
// continue;
// }
// //调整从表json格式,左侧去掉{,右侧也去掉}再加上逗号
// sJson = sJson + DataSetToJson(DsBody, DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString()).Remove(0, 1);
// sJson = sJson.Remove(sJson.Length - 1, 1) + ",";
// textLog.Text = textLog.Text + "\r\n " + now.ToString("yyyy-MM-dd HH:mm:ss ") + " 通讯" + DsSendCfgBody.Tables[0].Rows[j]["TblName"].ToString() + "表,已生成json数据" + DsBody.Tables[0].Rows.Count + "条";
//}
//if (sJson != "")
//{
// sJson = sJson.Remove(sJson.Length - 1, 1) + "}";//拼上最后一个大括号
// sJson = sJson.Replace((char)10, '&').Replace((char)13, '&');
// sJson = sJson.Replace("&", "<br>");
//}
//****************原拼接JSON语句End,可取消上述注释,用于验证通讯数量正确***************************************