using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;public partial class vote : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string a = DateTime.Today.ToString();
        SqlConnection Conn = new SqlConnection("server=ACDBA7FC19684F8\\SQLEXPRESS;database=abc;uid=zyl;pwd=123456");
        //此处需改为自己的连接
        string sql = "select * from vote where r1< '" + a + "' and r2 > '" + a + "' ";
        SqlDataAdapter Comm = new SqlDataAdapter(sql, Conn);
        DataSet ds = new DataSet();
        Comm.Fill(ds, "vote");
        
   
        if(ds.Tables[0].Rows.Count>0)   
     {
      Label6.Text = ds.Tables[0].Rows[0]["title"].ToString();
      Label1.Text = ds.Tables[0].Rows[0]["Vname1"].ToString();
      Label3.Text = ds.Tables[0].Rows[0]["Vname2"].ToString();
      Label5.Text = ds.Tables[0].Rows[0]["Vname3"].ToString();
      Label7.Text = ds.Tables[0].Rows[0]["Vname4"].ToString();
      }   
        else   
      {   
          Response.Write("表中无记录");   
      }
  
    
     
    }