Specified argument was out of the range of valid values.Parameter name: value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vijaychanderkk
    New Member
    • Dec 2011
    • 1

    Specified argument was out of the range of valid values.Parameter name: value

    When I am deleting a row from grid view I am getting following error. "Specified argument was out of the range of valid values.Paramete r name: value ". The following is the Stack Trace:

    [ArgumentOutOfRa ngeException: Specified argument was out of the range of valid values. Parameter name: value] System.Web.UI.W ebControls.Grid View.set_Select edIndex(Int32 value) +1353411 System.Web.UI.W ebControls.Grid View.HandleDele teCallback(Int3 2 affectedRows, Exception ex) +368 System.Web.UI.D ataSourceView.D elete(IDictiona ry keys, IDictionary oldValues, DataSourceViewO perationCallbac k callback) +137 System.Web.UI.W ebControls.Grid View.HandleDele te(GridViewRow row, Int32 rowIndex) +714 System.Web.UI.W ebControls.Grid View.HandleEven t(EventArgs e, Boolean causesValidatio n, String validationGroup ) +869 System.Web.UI.W ebControls.Grid View.OnBubbleEv ent(Object source, EventArgs e) +95 System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args) +37 System.Web.UI.W ebControls.Grid ViewRow.OnBubbl eEvent(Object source, EventArgs e) +123 System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args) +37 System.Web.UI.W ebControls.Link Button.OnComman d(CommandEventA rgs e) +118 System.Web.UI.W ebControls.Link Button.RaisePos tBackEvent(Stri ng eventArgument) +135 System.Web.UI.W ebControls.Link Button.System.W eb.UI.IPostBack EventHandler.Ra isePostBackEven t(String eventArgument) +10 System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +13 System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +175 System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1565

    Please suggest me.
  • Sivaranjani
    New Member
    • Dec 2011
    • 16

    #2
    I think you cannot passed the Parameter Value Correctly.
    Pass the Values that must be in the database table

    _sqlcom=new SqlCommand("Del ete from Student where RegNo='id'")

    In above 'id' is the Identity or PrimaryKey Column.
    The value of 'id' must be in the Student Table.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      It would help to see the code.

      Comment

      Working...