DataSet ds = DBHelp.DateSet(strSql.ToString());
int count = Store.Tables[0].Rows.Count;
if (ds.Tables[0].Rows.Count > 0)
{
string[] SingleStore = null;
for (int yy = 0; yy < count; yy++)
{
if (Store.Tables[0].Rows[yy][0].ToString() != "0")
{
if (U_Id != "")
{
SingleStore = Store.Tables[0].Rows[0][0].ToString().Split('|');//1,78|2,56|3,78|4,23
}
else
{
SingleStore = Store.Tables[0].Rows[yy][0].ToString().Split('|');//1,78|2,56|3,78|4,23
}
int ss = 0;
for (int cc = 0; cc < SingleStore.Length; cc++)
{
string[] MyScore = SingleStore[cc].Split(',');//1,78
ss = int.Parse(MyScore[1].ToString());
ds.Tables[0].Rows[yy][2 + cc] = ss.ToString();
}
}
}
}
return ds;
其中string[] SingleStore = null;是声明一个数组吗?还是什么
int count = Store.Tables[0].Rows.Count;
if (ds.Tables[0].Rows.Count > 0)
{
string[] SingleStore = null;
for (int yy = 0; yy < count; yy++)
{
if (Store.Tables[0].Rows[yy][0].ToString() != "0")
{
if (U_Id != "")
{
SingleStore = Store.Tables[0].Rows[0][0].ToString().Split('|');//1,78|2,56|3,78|4,23
}
else
{
SingleStore = Store.Tables[0].Rows[yy][0].ToString().Split('|');//1,78|2,56|3,78|4,23
}
int ss = 0;
for (int cc = 0; cc < SingleStore.Length; cc++)
{
string[] MyScore = SingleStore[cc].Split(',');//1,78
ss = int.Parse(MyScore[1].ToString());
ds.Tables[0].Rows[yy][2 + cc] = ss.ToString();
}
}
}
}
return ds;
其中string[] SingleStore = null;是声明一个数组吗?还是什么
解决方案 »
- ObjectDataSource 取值问题
- C#连接数据库时出错,非常规错误,请高手帮忙解决!
- Asp.net中对word文档操作时 添加引用出错 急急急!!!!!!!
- TreeView 的节点显示问题
- 如何区分是从其它页跳入本页还是本页刷新
- asp.netGridView一直没有解决的简单问题,请进
- Eval 格式化.
- 面象对象时,数据库不能保存“对象”而只能保存“对象编号”,那请问如何完美的将数据库中的“对象编号”与逻辑中使用的“对象”关联起来?
- asp.net是不是不可以同IBM的DB2連接
- TreeView
- EF Code First设置int主键初始值的问题
- 关于repeater中的DataSourceID和OnItemDataBound
DataSet ds = DBHelp.DateSet(strSql.ToString()); //获取数据集,根据sql
int count = Store.Tables[0].Rows.Count;//记录数
if (ds.Tables[0].Rows.Count > 0)
{
string[] SingleStore = null;
for (int yy = 0; yy < count; yy++)//此处开始遍历记录
{
if (Store.Tables[0].Rows[yy][0].ToString() != "0")//如果第yy索引行第一个列的值不等0
{
if (U_Id != "")
{
SingleStore = Store.Tables[0].Rows[0][0].ToString().Split('|');//1,78|2,56|3,78|4,23//字符串分割,以'|'为分隔符,将单元格内容分割为数组
}
else
{
SingleStore = Store.Tables[0].Rows[yy][0].ToString().Split('|');//1,78|2,56|3,78|4,23//同上
}
int ss = 0;
for (int cc = 0; cc < SingleStore.Length; cc++)//根据数组的记录数循环
{
string[] MyScore = SingleStore[cc].Split(',');//1,78
ss = int.Parse(MyScore[1].ToString());//转为int型
ds.Tables[0].Rows[yy][2 + cc] = ss.ToString();
}
}
}
}
return ds;