dim conn as sqlconnection=new sqlconnection(ConnString)
dim strSQL as string="..."
dim ad as sqldataadapter=new sqldataadapter(srtSQL,conn)
dim dataset as dataset=new dataset()
ad.fill(dataset,"表名")
dim dr() as datarow
dr=dataset.tables("表名").select(条件)
通过dr(0)(字段名)即可读取

解决方案 »

  1.   

    DataSet ds;
    DataRow dr;
    dr=ds.Tables[0].Rows[0];
    string temp=dr["colname"].ToString();
      

  2.   

    假设是第三行,第四列
    Response.Write(dataset1.tables[0].Rows[2][3].ToString());
      

  3.   

    you try
    string val1 = ds.Tables[0].Rows[0]["Column"].ToString();//取得值是字符型
    int val2 = (int)ds.Tables[0].Rows[0]["Column"];//取得值是整型
      

  4.   

    表中有id、name列。
    找出id=5时的name值:
    DataSet ds;
    DataRowView dr;
    1、
      DataTable customerTable = ds.Tables[“表名”];
     DataView dv=new DataView(customerTable,"id=5","id",DataViewRowState.CurrentRows);
     dr=dv[0];
      string name=dr["name"].ToString;
    2、
      DataTable customerTable = ds.Tables[“表名”];
     DataView dv=new DataView(customerTable,"","id",DataViewRowState.CurrentRows);
     int rowIndex = dv.Find(id);
     dr=dv[rowIndex];
      string name=dr["name"].ToString;
      

  5.   

    错了:
    int rowIndex = dv.Find(“5”);
      

  6.   

    错了:
    1、
    DataView dv=new DataView(customerTable,"id='5'","id",DataViewRowState.CurrentRows);