我写了一个消息发布的小网站,用的是Access数据库,在读取消息的页面上,有的消息可以完整的显示,可是有的却是什么也没有,而这些问题在IE7中却没有出现.请大家指点!

解决方案 »

  1.   

    IE只能显示的是WEB页,它与数据库没有什么必然关系,
    应该是你的程序没写好!
      

  2.   

    IE跟数据库没有关系,就算没有数据库一样能查看网页吧
    看样子很有可能是CSS样式或JS有兼容问题,这种情况比较多
      

  3.   

    可是我只要把消息的标题中的文字从Access中去掉一个字,它们就能正常显示了呀!
      

  4.   

    这肯定是你的程序没有处理好,
    刚才已经说了,IE与数据库之间没有关系!!!
    IE只负责显示网页,读取数据库是你写程序的事了。
    建议你将相关代码贴出来。
      

  5.   

    我是让新闻显示在DataList中,
    前台页面的DataList的HTML是这样的:
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server" >
                        <div style="width: 603px;height:750px; text-align:center; vertical-align:top;background:url('images/page_image/danghui.jpg') no-repeat center;background-color:White;">
                        <asp:DataList ID="DataList2" runat="server" Height="100%" Width="603px" ShowFooter="False" ShowHeader="False">
                            <ItemTemplate>
                           <table style="width: 577px; height: auto">
                                <tr style="width: 586px; height: 30px; font-size:large"> 
                                <td style="width: auto; height: 30px;"><%#DataBinder.Eval(Container.DataItem, "title")%></td>
                                </tr>
                                
                                <tr style="width: 586px; height: 30px">
                                <td style="width: auto"><%#DataBinder.Eval(Container.DataItem, "time")%></td>
                                </tr>
                                
                                <tr style="width: 586px;  text-align:left;">
                                <td style="height: auto"><%#DataBinder.Eval(Container.DataItem, "content")%></td>
                                </tr>
                                
                            </table>
                            </ItemTemplate>
                        </asp:DataList>
                        </div></asp:Content>后台的.cs代码如下:
    public partial class readnews1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id;
                if (Request.QueryString["title"] != null)
                {
                    id = Convert.ToString(Request.QueryString["title"].ToString());            }
                else
                {
                    id = "";
                }
                bind(id);
            }
        }
        protected void bind(string id)
        {
            OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/News.mdb"));
            conn.Open();
            OleDbCommand comm = new OleDbCommand("select  title,time,content from NewList where title='" + id.ToString() + "' order by time desc", conn);
            OleDbDataReader result = comm.ExecuteReader(CommandBehavior.CloseConnection);
            DataList2.DataSource = result;
            DataList2.DataBind();
            conn.Close();    }}