dataSet.Tables[0].Rows[i]["字段名"]

解决方案 »

  1.   

    ds.Tables[0].Rows[行索引][列索引].ToString();
      

  2.   

    object objValue = ds.Tables["hehe"].Rows[行索引][列索引];
      

  3.   

    就是DataRow的索引,
    object objValue = ds.Tables["hehe"].Rows[行索引][列索引];
    另外,如果楼主想到数据库取,如下:
    /// <summary>
    /// 获取单个值
    /// </summary>
    /// <param name="strSql"></param>
    /// <returns></returns>
    public static object ExecuteScalar(string strSql)
    {
    object o = null;
    OleDbConnection myConn = new OleDbConnection(strConn);
    OleDbCommand myComm = new OleDbCommand(strSql,myConn);
    try
    {
    myConn.Open();
    o = myComm.ExecuteScalar();
    }
    catch(Exception e)
    {

    }
    finally
    {
    myConn.Close();
    }
    return o;
    }当然你的sql语句类是与:select dd,rr form table2;
    返回的是第一个子段的值,上面是dd.
      

  4.   

    ds.Tables[0].Rows[行索引][列索引].ToString();
    就是这个了
      

  5.   

    反正说的你们都说了
    bitsbird(一瓢.net) 
    就按照他的没有问题