Label1.Text=dr["dDate"].ToString();

解决方案 »

  1.   

    dr是什么东西呢?是不是数据绑定,要用到哪几个空间!?
    用code behind怎么来写,谢谢!马上加分到50!
      

  2.   

    就是codebehind呀,
    using System.Data.SqlClient;
    dr-->SqlDataReaer
      

  3.   

    假如数据库表名是mytbl,你说的那个日期字段是adddate,可以这样做:SqlConnection conn=new SqlConnection(....);//自己写
    SqlCommand cmd=new SqlCommand("select top 1 adddate from mytbl order by adddate desc",conn);
    conn.Open();
    DateTime mydate=(DateTime)cmd.ExecuteScalar();
    conn.Close();mylabel.Text=mydate.ToLongDateString();--------------------------------
    AspNetPager 免费分页控件2.0版发布,新增Url分布功能,欢迎下载使用:http://www.webdiyer.com
      

  4.   

    sql="select top 1 adddate from time order by adddate desc"
    comm=new sqldataadapter(sql,mconn)
    comm.fill(ds,"time")
    dim dv as dataview
    dv=ds.tables("time").defaultview
    dv.RowFilter="time2<>''"
    id12.Text=dv(0)("adddate").ToString()这是我最后试出的正确方式,还是感谢 cmsoft 和 webdiyer