
-
65 point Member
-
sbudlong
- Member since 08-19-2007, 8:32 PM
- Posts 124
|
I get this error when I click Update in the page code below, using a stored procedure. I built a similar Insert page, which works normally. Can anyone see the error on this page? I don't think it's a problem with the stored procedure.
Procedure or function uspUpdateSellingZone has too many arguments specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Procedure or function uspUpdateSellingZone has too many arguments specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. | Stack Trace:
[SqlException (0x80131904): Procedure or function uspUpdateSellingZone has too many arguments specified.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +186
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1121
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +334
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +407
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +149
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +495
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +921
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +179
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1143
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +835
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +163
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +119
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +178
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3838
|
*************************************************************
Page code
< asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="SellingZoneKey" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="SellingZoneKey" HeaderText="SellingZoneKey" InsertVisible="False"
ReadOnly="True" SortExpression="SellingZoneKey" />
<asp:BoundField DataField="Zone" HeaderText="Zone" SortExpression="Zone" />
<asp:BoundField DataField="Subzone" HeaderText="Subzone" SortExpression="Subzone" /><asp:BoundField DataField="Descr" HeaderText="Descr" SortExpression="Descr" />
<asp:BoundField DataField="PDiv" HeaderText="PDiv" SortExpression="PDiv" />
<asp:BoundField DataField="Level" HeaderText="Level" SortExpression="Level" />
<asp:CheckBoxField DataField="IsHSQ" HeaderText="IsHSQ" SortExpression="IsHSQ" />
</Columns>
</asp:GridView>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MEDataWarehouseConnectionString %>"
SelectCommand="uspGetSellingZones" UpdateCommand="uspUpdateSellingZone" SelectCommandType="StoredProcedure" UpdateCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="sintSellingZoneKey" Type="Int16" />
<asp:Parameter Name="sintZone" Type="Int16" />
<asp:Parameter Name="sintSubzone" Type="Int16" />
<asp:Parameter Name="strDescr" Type="String" />
<asp:Parameter Name="intPDiv" Type="Int32" />
<asp:Parameter Name="tintLevel" Type="Byte" />
<asp:Parameter Name="bitIsHSQ" Type="Boolean" />
</UpdateParameters>
</asp:SqlDataSource>
**********************************************************************
Stored Procedure set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[uspUpdateSellingZone]
@sintSellingZoneKey smallint, @sintZone smallint = -1,
@sintSubzone smallint = -1,
@strDescr varchar(100),
@intPDiv int,
@tintLevel tinyint,
@bitIsHSQ bit,@SCDBeginDate smalldatetime
AS
UPDATE [tblSellingZones_Dim] SET [Zone] = @sintZone
, [Subzone] = @sintSubzone, [Descr] = @strDescr
, [PDiv] = @intPDiv, [Level] = @tintLevel
, [IsHSQ] = @bitIsHSQ
, [SCDBeginDate] = getdate() WHERE [SellingZoneKey] = @sintSellingZoneKey
|
|