当数据为空时,IE会死掉!!
OleDbConnection sqlCon = Connection.Dataconnection();
DataSet ds = new DataSet();
OleDbCommand sqlCmd = new OleDbCommand("SELECT * FROM [Users] WHERE ([Class] = '2') ORDER BY A_datetime DESC ", sqlCon);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sqlCmd);
sqlCon.Open();
dataAdapter.Fill(ds);
sqlCon.Close();
Repeater1.DataSource = ds.Tables[0].DefaultView;
Repeater1.DataBind();
这是怎么回事,一但数据库中没有数据IE就会死掉了。。。 --------------------编程问答-------------------- 死循环了吧? --------------------编程问答-------------------- 怎么解决呢!!! --------------------编程问答-------------------- dataAdapter.Fill(ds,"表呢??");
--------------------编程问答-------------------- dataAdapter.Fill(ds,"Users");
加了表也是一样的死机 --------------------编程问答-------------------- 不是死机,是IE死掉 --------------------编程问答-------------------- OleDbCommand sqlCmd = new OleDbCommand("SELECT * FROM [Users] WHERE ([Class] = 2) ORDER BY A_datetime DESC ", sqlCon);
--------------------编程问答-------------------- 这句有什么问题吗? --------------------编程问答-------------------- 没有人知道吗? --------------------编程问答-------------------- sql 语句写错了吧
SELECT * FROM [Users] WHERE [Class] = 2 ORDER BY A_datetime DESC 应该是这样吧 --------------------编程问答-------------------- 肯定是形成了死循环。 --------------------编程问答-------------------- http://bbs.doughty.cn --------------------编程问答-------------------- 不是这样的啊!!
我数据库里面是定义为文本类型的!! --------------------编程问答-------------------- div id="marquees">
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<div class="photo1"><a target="_blank" href="../Garden/Parade.aspx" ><img border="0" class="img02" src='<%#DataBinder.Eval(Container.DataItem,"PicImg") %>' alt='学员姓名:<%#DataBinder.Eval(Container.DataItem,"UserName") %>
备注:<%#DataBinder.Eval(Container.DataItem,"Jianjie") %>'/></a></div>
</ItemTemplate>
</asp:Repeater>
</div>
<div id="templayer" style="position:absolute;left:0;top:0;visibility:hidden"></div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SumxinConnectionString %>"
ProviderName="<%$ ConnectionStrings:SumxinConnectionString.ProviderName %>"
SelectCommand="SELECT * FROM [Users] WHERE ([Class] = '3') ORDER BY [A_datetime] DESC">
</asp:SqlDataSource>
<script type="text/javascript">
marqueesWidth=530;
with(marquees){
style.height=0;
style.width=marqueesWidth;
style.overflowX="hidden";
style.overflowY="visible";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preLeft=0; currentLeft=0; stopscroll=false;
function init(){
templayer.innerHTML="";
while(templayer.offsetWidth<marqueesWidth){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML+=templayer.innerHTML;
setInterval("scrollLeft()",10);
}init();
function scrollLeft(){
if(stopscroll==true) return;
preLeft=marquees.scrollLeft;
marquees.scrollLeft+=1;
if(preLeft==marquees.scrollLeft){
marquees.scrollLeft=templayer.offsetWidth-marqueesWidth+1;
}
}
</script>
原来是JS 搞得问题!!!
补充:.NET技术 , ASP.NET