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.OleDb;

public partial class AddToAccess : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        getUrl();
    }

    void getUrl()
    {
        OleDbDataReader dr = null;
        try
        {
            
            string sql = "SELECT * FROM YTJ WHERE YTYPE=FALSE ORDER BY ydate ASC";
            dr = SqlHelper.ExecuteReader(sql, null);
            string str = "";
            while (dr.Read())
            {
               string s = dr["site"].ToString().Replace("http://", "");
                str += string.Format("<li><a href=\"http://{0}\" target=\"_blank\">{0}</a></li>", Server.HtmlEncode(s));
            }
            this.divList.InnerHtml = str;
        }
        catch (Exception ex)
        {
            this.divList.InnerHtml = " 读取数据错误：" + ex.Message;
        }
        finally { if (dr != null) dr.Close(); }
    }
}
