string strvalue = datatable1.rows[i]["fieldname"].tostring()

解决方案 »

  1.   

    DataTable t;
    用下面的方法。
    string s  = (string)t.Rows[0][0];
      

  2.   

    DataRow theRow1 = thisds.Tables["table_1"].Rows[2];值= (Decimal)theRow1["列名"];
      

  3.   

    更正一下
    DataRow theRow1 = thisds.Tables["table_1"].Rows[2];值= theRow1["列名"].ToString();
      

  4.   

    string strvalue = datatable1.rows[i][fieldname].tostring()就行了
    string strvalue = datatable1.rows[i][fieldindex].tostring()是一样的
    fieldname是要查找的字段的名称
    fieldindex是字段的序列号(从0开始)