DataSet ds = new DataSet();
.....lable.Text = ds.Table[0].Row[0]["id"].ToString();

解决方案 »

  1.   

    <DIV style="DISPLAY: inline; Z-INDEX: 102; LEFT: 328px; WIDTH: 70px; POSITION: absolute; TOP: 328px; HEIGHT: 15px"
    ms_positioning="FlowLayout">
    <%
    Response.Write(ds.Table[0].Row[0]["id"].ToString());
    %>
    </DIV>
      

  2.   

    label.text=ds.table[0].row[0].item[xx].tostring
      

  3.   

    label.text=ds.table[0].row[0].item[xx].tostring();
      

  4.   


    SqlConnection con = new SqlConnection("server=.;Integrated Security=True;Database=数据库名");//创建数据库链接
    string sql = "select 你要查的列名 from test where 条件";
    SqlCommand cmd = new SqlCommand(sql,con);
    con.Open();
    object result = cmd.ExecuteScalar();
    con.Close();
    label.text=result.tostring();
      

  5.   

    lable.Text = ds.Table[0].Row[0]["id"].ToString();