- 爱易网页
-
ASP.NET教程
- 一个简单的小异常~ 有关问题在哪里呢
日期:2014-05-19 浏览次数:20508 次
一个简单的小错误~! 问题在哪里呢?
出错信息:
当传递具有已修改行的 DataRow 集合时,更新要求有效的 UpdateCommand。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<%@Import Namespace=System.Data.oledb%>
<%@Import Namespace=System.Data%>
<head runat= "server ">
<title> 无标题页 </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
<asp:DataList ID= "dlA " runat= "server " OnItemCommand= "dlA_ICMD " GridLines= "Horizontal ">
<ItemTemplate>
<ASP:Image ID= "Image1 " ImageUrl= "ico1.gif " Runat= "Server "/>
姓名: <%#Container.DataItem( "UserName ")%>
<ASP:LinkButton Id= "lbShow " Text= "> " Runat= "Server "/>
</ItemTemplate>
<EditItemTemplate>
<ASP:Image ImageUrl= "ico1.gif " Runat= "Server "/>
姓名: <%#Container.DataItem( "UserName ")%> <br/>
电话: <ASP:TextBox Id= "T1 " Text= ' <%#Container.DataItem( "phone ")%> ' Runat= "Server "/> <br/>
住址: <ASP:TextBox Id= "T2 " Text= ' <%#Container.DataItem( "firstName ")%> ' Runat= "Server "/> <br/>
电邮: <ASP:TextBox Id= "T3 " Text= ' <%#Container.DataItem( "lastName ")%> ' Runat= "Server "/> <br/>
<ASP:LinkButton Id= "lbCancel " Text= "[放弃] " Runat= "Server "/>
<ASP:LinkButton Id= "lbSubmit " Text= "[确定] " Runat= "Server "/> <br/>
</EditItemTemplate>
<SelectedItemTemplate>
<ASP:Image ImageUrl= "ico1.gif " Runat= "Server "/>
姓名: <%#Container.DataItem( "UserName ")%>
<ASP:LinkButton Id= "lbClose " Text= " < " Runat= "Server "/> <br/>
电话: <%#Container.DataItem( "phone ")%> <br/>
住址: <%#Container.DataItem( "firstName ")%> <br/>
电邮: <%#Container.DataItem( "lastName ")%> <br/>
<ASP:LinkButton Id= "lbEdit " Text= "[编辑] " Runat= "Server "/> <br/>
</SelectedItemTemplate>
</asp:DataList>
</div>
</form>
<Script Language= "VB " Runat= "Server ">