当前位置: 代码迷 >> C# >> C#中如何读取数据集中的某个表的某个单元格的Value? 新手求指教
  详细解决方案

C#中如何读取数据集中的某个表的某个单元格的Value? 新手求指教

热度:10528   发布时间:2013-02-25 00:00:00.0
C#中怎么读取数据集中的某个表的某个单元格的Value?? 新手求指教
C#中怎么读取数据集中的某个表的某个单元格的Value?? 

为什么 我DataSet.tables["name"].rows[0].cells[0].value 这样不行呢??

------解决方案--------------------------------------------------------
dataSet1.Tables["name"].Rows[0]["字段"].ToString()
------解决方案--------------------------------------------------------
例如


          lId = Convert.ToInt64(ds.Tables[0].Rows[0].ItemArray[0]);
          lId_Ne = Convert.ToInt64(ds.Tables[0].Rows[0].ItemArray[1]);
          lId_NF = Convert.ToInt64(ds.Tables[0].Rows[0].ItemArray[2]);
          lType = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[3]);
          lData = Convert.ToInt64(ds.Tables[0].Rows[0].ItemArray[4]);
          strName = ds.Tables[0].Rows[0].ItemArray[5].ToString();



------解决方案--------------------------------------------------------
dataset里面你这个表叫name么?
  相关解决方案