Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 The argument specified was not within the range of

Author  Topic 

tngtng
Starting Member

7 Posts

Posted - 2010-04-13 : 08:10:00
Hi,

I have 2 tables:
order: reference (primary key), reference_projet(decimal(18,0)), reference_budget(decimal(18,0), budget_name(varchar(50)
budget: reference (primary key, which is order.reference_budget), name(varchar(50))

and 2 webpages :
order: dropdownlist budget_name, list all budgets of the project in which is the order + 'Non referenced' (which is in no project)
budget: gridviewBudget with the command 'delete'

an order is associated to a budget. If the budget is deleted (from the budget page), orders having this budget will replace this budget by 'Non referenced' in their dropdownlist

This works when the last budget deleted from the gridviewBudget is not associated to an order.
Ex:budgetA, budgetB, budgetC
order1: budgetA
order2: budgetB
if we delete in order: budgetA, budgetB, then budgetC(not associated to any order), it works. If we delete budgetA, budgetC, budgetB (which is associated to an order: order2), error:

"The argument specified was not within the range of valid values. Parameter name: value
Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: The argument specified was not within the range of valid values. Parameter name: value
Source Error: An unhandled exception occurred during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the stack trace of exception below.
Stack Trace: [ArgumentOutOfRangeException: The argument specified was not within the range of valid values.
Parameter name : value]
System.Web.UI.WebControls.GridView.set_SelectedIndex(Int32 value) +1352651
System.Web.UI.WebControls.GridView.HandleDeleteCallback(Int32 affectedRows, Exception ex) +368
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +137
System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +714
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +869
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(orderventArgs e) +118
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
"

Why this difference? Thanks for your help!
   

- Advertisement -