IE6无法正常显示Access中的数据是怎么回事? 我写了一个消息发布的小网站,用的是Access数据库,在读取消息的页面上,有的消息可以完整的显示,可是有的却是什么也没有,而这些问题在IE7中却没有出现.请大家指点! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 IE只能显示的是WEB页,它与数据库没有什么必然关系,应该是你的程序没写好! IE跟数据库没有关系,就算没有数据库一样能查看网页吧看样子很有可能是CSS样式或JS有兼容问题,这种情况比较多 可是我只要把消息的标题中的文字从Access中去掉一个字,它们就能正常显示了呀! 这肯定是你的程序没有处理好,刚才已经说了,IE与数据库之间没有关系!!!IE只负责显示网页,读取数据库是你写程序的事了。建议你将相关代码贴出来。 我是让新闻显示在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(); }} 有关jquery 有没有办法把数据库里保存的图片路径赋值给FileUpload? DataGrid的列宽问题 用vs2003,不同步cs文件,烦躁的很 求助:web窗体中的全局变量怎么定义?在线 教大家如何去处<title></title>标记中的内容 老问题,请高手过目.急急急,给出具体的解决办法. 如何让windows2003server支持asp的页面?急!! 小弟真心诚意学习>相信csdn的热情会让小弟有所长进 求datagrid数据导出到excel的完整代碼.最近要用到這功能,會的朋友請多幫忙. ASP.NET 打印A4大小的内容 “/”应用程序中的服务器错误。
应该是你的程序没写好!
看样子很有可能是CSS样式或JS有兼容问题,这种情况比较多
刚才已经说了,IE与数据库之间没有关系!!!
IE只负责显示网页,读取数据库是你写程序的事了。
建议你将相关代码贴出来。
前台页面的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(); }}