62,041
社区成员
发帖
与我相关
我的任务
分享
[code=csharp]
<省略******>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="更新" />
<asp:Button ID="Button2" runat="server" Text="添加" />
<asp:GridView Font-Size="14px" ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" DataKeyNames="ID">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" ReadOnly="True" />
<asp:BoundField DataField="Category" HeaderText="CategoryID" SortExpression="Category" />
<asp:BoundField DataField="Variety" HeaderText="Variety" SortExpression="Variety" />
<asp:BoundField DataField="Color" HeaderText ="ColorID" SortExpression="Color" />
<asp:BoundField DataField="WearLayer" HeaderText="WearLayerID" SortExpression="WearLayer" />
<asp:BoundField DataField="Thickness" HeaderText="ThicknessID" SortExpression="Thickness" />
<asp:BoundField DataField="Type" HeaderText="TypeID" SortExpression="Type" />
<asp:BoundField DataField="Repertory" HeaderText="Repertory" SortExpression="Repertory" />
<asp:BoundField DataField="Specification" HeaderText="Specification" SortExpression="Specification" />
<asp:BoundField DataField="Square" HeaderText="Square" SortExpression="Square" />
<asp:BoundField DataField="RouteSquare" HeaderText="RouteSquare" SortExpression="RouteSquare" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Box" HeaderText="Box" SortExpression="Box" />
<asp:BoundField DataField="Remark" HeaderText="Remark" SortExpression="Remark" />
</Columns>
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
<PagerSettings FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PreviousPageText="上一页" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
<RowStyle BackColor="White" ForeColor="#003399" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<SortedAscendingCellStyle BackColor="#EDF6F6" />
<SortedAscendingHeaderStyle BackColor="#0D4AC4" />
<SortedDescendingCellStyle BackColor="#D6DFDF" />
<SortedDescendingHeaderStyle BackColor="#002876" />
“/”应用程序中的服务器错误。
变量名 '@original_Category' 已声明。变量名在查询批次或存储过程内部必须唯一。
“,”附近有语法错误。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 变量名 '@original_Category' 已声明。变量名在查询批次或存储过程内部必须唯一。
“,”附近有语法错误。
源错误:
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[SqlException (0x80131904): 变量名 '@original_Category' 已声明。变量名在查询批次或存储过程内部必须唯一。
“,”附近有语法错误。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1753346
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5295154
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +242
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1682
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +269
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) +1325
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +175
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +205
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +160
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +380
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +568
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +84
System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +930
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +974
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +205
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9643314
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AMSZConnectionString %>" SelectCommand="
select ID,Category,Color,Repertory,Type,Variety,WearLayer,
Thickness,Specification,Square,RouteSquare,Date,Box,Remark
from KC,Color,Category,WearLay,Thickness,Type
where
KC.ColorID=Color.ColorID
and KC.CategoryID=Category.CID
and KC.ThicknessID = Thickness.ThicknessID
and WearLay.WearLayerID = KC.WearLayerID
and KC.TypeID = Type.TypeID
group by ID,Color,Category,Repertory,Type,Variety,
WearLayer,Thickness,Specification,Square,Repertory,RouteSquare,Date,Box,Remark
"
ConflictDetection="CompareAllValues"
DeleteCommand="DELETE FROM [KC],[Color],[Category],[WearLay],[Thickness],[Type] WHERE [ID] = @original_ID AND (([CategoryID] = @original_CategoryID) OR ([CategoryID] IS NULL AND @original_CategoryID IS NULL)) AND (([Variety] = @original_Variety) OR ([Variety] IS NULL AND @original_Variety IS NULL)) AND (([ColorID] = @original_ColorID) OR ([ColorID] IS NULL AND @original_ColorID IS NULL)) AND (([WearLayerID] = @original_WearLayerID) OR ([WearLayerID] IS NULL AND @original_WearLayerID IS NULL)) AND (([ThicknessID] = @original_ThicknessID) OR ([ThicknessID] IS NULL AND @original_ThicknessID IS NULL)) AND (([TypeID] = @original_TypeID) OR ([TypeID] IS NULL AND @original_TypeID IS NULL)) AND (([Repertory] = @original_Repertory) OR ([Repertory] IS NULL AND @original_Repertory IS NULL)) AND (([Specification] = @original_Specification) OR ([Specification] IS NULL AND @original_Specification IS NULL)) AND (([Square] = @original_Square) OR ([Square] IS NULL AND @original_Square IS NULL)) AND (([RouteSquare] = @original_RouteSquare) OR ([RouteSquare] IS NULL AND @original_RouteSquare IS NULL)) AND (([Date] = @original_Date) OR ([Date] IS NULL AND @original_Date IS NULL)) AND (([Box] = @original_Box) OR ([Box] IS NULL AND @original_Box IS NULL)) AND (([Remark] = @original_Remark) OR ([Remark] IS NULL AND @original_Remark IS NULL))"
InsertCommand="INSERT INTO [KC],[Color],[Category],[WearLay],[Thickness],[Type] ([ID], [CategoryID], [Variety], [ColorID], [WearLayerID], [ThicknessID], [TypeID], [Repertory], [Specification], [Square], [RouteSquare], [Date], [Box], [Remark]) VALUES (@ID, @CategoryID, @Variety, @ColorID, @WearLayerID, @ThicknessID, @TypeID, @Repertory, @Specification, @Square, @RouteSquare, @Date, @Box, @Remark)"
OldValuesParameterFormatString="original_{0}"
UpdateCommand ="UPDATE [KC],[Color],[Category],[WearLay],[Thickness],[Type] SET [CategoryID] = @CategoryID, [Variety] = @Variety, [ColorID] = @ColorID, [WearLayerID] = @WearLayerID, [ThicknessID] = @ThicknessID, [TypeID] = @TypeID, [Repertory] = @Repertory, [Specification] = @Specification, [Square] = @Square, [RouteSquare] = @RouteSquare, [Date] = @Date, [Box] = @Box, [Remark] = @Remark WHERE [ID] = @original_ID AND (([CategoryID] = @original_CategoryID) OR ([CategoryID] IS NULL AND @original_CategoryID IS NULL)) AND (([Variety] = @original_Variety) OR ([Variety] IS NULL AND @original_Variety IS NULL)) AND (([ColorID] = @original_ColorID) OR ([ColorID] IS NULL AND @original_ColorID IS NULL)) AND (([WearLayerID] = @original_WearLayerID) OR ([WearLayerID] IS NULL AND @original_WearLayerID IS NULL)) AND (([ThicknessID] = @original_ThicknessID) OR ([ThicknessID] IS NULL AND @original_ThicknessID IS NULL)) AND (([TypeID] = @original_TypeID) OR ([TypeID] IS NULL AND @original_TypeID IS NULL)) AND (([Repertory] = @original_Repertory) OR ([Repertory] IS NULL AND @original_Repertory IS NULL)) AND (([Specification] = @original_Specification) OR ([Specification] IS NULL AND @original_Specification IS NULL)) AND (([Square] = @original_Square) OR ([Square] IS NULL AND @original_Square IS NULL)) AND (([RouteSquare] = @original_RouteSquare) OR ([RouteSquare] IS NULL AND @original_RouteSquare IS NULL)) AND (([Date] = @original_Date) OR ([Date] IS NULL AND @original_Date IS NULL)) AND (([Box] = @original_Box) OR ([Box] IS NULL AND @original_Box IS NULL)) AND (([Remark] = @original_Remark) OR ([Remark] IS NULL AND @original_Remark IS NULL))">
<DeleteParameters>
<asp:Parameter Name="original_ID" Type="Int32" />
<asp:Parameter Name="original_Category " Type="Int32" />
<asp:Parameter Name="original_Variety" Type="String" />
<asp:Parameter Name="original_Color " Type="Int32" />
<asp:Parameter Name="original_WearLayerID" Type="Int32" />
<asp:Parameter Name="original_ThicknessID" Type="Int32" />
<asp:Parameter Name="original_TypeID" Type="Int32" />
<asp:Parameter Name="original_Repertory" Type="Int32" />
<asp:Parameter Name="original_Specification" Type="String" />
<asp:Parameter Name="original_Square" Type="String" />
<asp:Parameter Name="original_RouteSquare" Type="String" />
<asp:Parameter Name="original_Date" Type="String" />
<asp:Parameter Name="original_Box" Type="Int32" />
<asp:Parameter Name="original_Remark" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="Variety" Type="String" />
<asp:Parameter Name="ColorID" Type="Int32" />
<asp:Parameter Name="WearLayerID" Type="Int32" />
<asp:Parameter Name="ThicknessID" Type="Int32" />
<asp:Parameter Name="TypeID" Type="Int32" />
<asp:Parameter Name="Repertory" Type="Int32" />
<asp:Parameter Name="Specification" Type="String" />
<asp:Parameter Name="Square" Type="String" />
<asp:Parameter Name="RouteSquare" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Box" Type="Int32" />
<asp:Parameter Name="Remark" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="Variety" Type="String" />
<asp:Parameter Name="ColorID" Type="Int32" />
<asp:Parameter Name="WearLayerID" Type="Int32" />
<asp:Parameter Name="ThicknessID" Type="Int32" />
<asp:Parameter Name="TypeID" Type="Int32" />
<asp:Parameter Name="Repertory" Type="Int32" />
<asp:Parameter Name="Specification" Type="String" />
<asp:Parameter Name="Square" Type="String" />
<asp:Parameter Name="RouteSquare" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Box" Type="Int32" />
<asp:Parameter Name="Remark" Type="String" />
<asp:Parameter Name="original_ID" Type="Int32" />
<asp:Parameter Name="original_CategoryID" Type="Int32" />
<asp:Parameter Name="original_Variety" Type="String" />
<asp:Parameter Name="original_ColorID" Type="Int32" />
<asp:Parameter Name="original_WearLayerID" Type="Int32" />
<asp:Parameter Name="original_ThicknessID" Type="Int32" />
<asp:Parameter Name="original_TypeID" Type="Int32" />
<asp:Parameter Name="original_Repertory" Type="Int32" />
<asp:Parameter Name="original_Specification" Type="String" />
<asp:Parameter Name="original_Square" Type="String" />
<asp:Parameter Name="original_RouteSquare" Type="String" />
<asp:Parameter Name="original_Date" Type="String" />
<asp:Parameter Name="original_Box" Type="Int32" />
<asp:Parameter Name="original_Remark" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
[/code]