首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

c#怎么实现以下效果

2012-06-16 
c#如何实现以下效果?C# codePosGroup.Lane.Row[m].Col[n].Layer[h].Pos.PosState Convert.ToInt32(ds1.T

c#如何实现以下效果?

C# code
PosGroup.Lane.Row[m].Col[n].Layer[h].Pos.PosState = Convert.ToInt32(ds1.Tables[0].Rows[i]["Pos_State"]);



[解决办法]
把 for(int m=0;m<=IRow;m++) 循环整个换成下面的代码,看哪行出的错
C# code
var lane = PosGroup.Lane;var row = lane.Row;for (int m = 0; m <= IRow; m++){    PosGroup.Lane.Row[m] = new TRow();    for (int n = 0; n <= ICol; ICol++)    {        PosGroup.Lane.Row[m].Col[n] = new TCol();        for (int h = 0; h <= ILayer; h++)        {            PosGroup.Lane.Row[m].Col[n].Layer[h] = new TLayer();            PosGroup.Lane.Row[m].Col[n].Layer[h].Pos.PosState = Convert.ToInt32(ds1.Tables[0].Rows[i]["Pos_State"]);            PosGroup.Lane.Row[m].Col[n].Layer[h].Pos.Zone_ID = Convert.ToInt32(ds1.Tables[0].Rows[i]["Zone_ID"]);            PosGroup.Lane.Row[m].Col[n].Layer[h].Pos.PID = Convert.ToInt32(ds1.Tables[0].Rows[i]["PID"]);            PosGroup.Lane.Row[m].Col[n].Layer[h].Pos.HasSetValue = true;        }    }} 

热点排行