mnichols1202
asked on
HELP!!!! System.FormatException: Input string was not in a correct format. in GridView RowUpdating Event
I've tried everything!!!! I have other pages that work fine. This refuses to work!
Here is the RowUpdating Event Code.
SqlDataSource1.UpdateParam
SqlDataSource1.UpdateParam
SqlDataSource1.UpdateParam
SqlDataSource1.UpdateParam
SqlDataSource1.UpdateParam
SqlDataSource1.UpdateParam
SqlDataSource1.UpdateParam
(I added the hard values because i know they work. If i load those into the Stored proc directly they work fine!)
Here the Params from asp:
<UpdateParameters>
<asp:Parameter Name="ID" Type="Decimal" />
<asp:Parameter Name="REG_ID" Type="Decimal" />
<asp:Parameter Name="CSA_Major_Topic_Cate
<asp:Parameter Name="CSA_Specialized_Serv
<asp:Parameter Name="CSA_Distance_Limitat
<asp:Parameter Name="CSA_Service_Charge_B
<asp:Parameter Name="CSA_Service_Charge_A
<asp:Parameter Name="CSA_Specialized_Serv
</UpdateParameters>
No matter what i do i get "System.FormatException: Input string was not in a correct format."
The stack trace is useless!!! I'll post if you think it'll help
I'm at a loss as to even figure out how to begin to figure this one out. I've tried everything i know.
500 points cause this is URGENT! So urgent in fact i'd give 1000 points if i could!
ASKER
I had already tried that and same result!
k... post stack trace... maybe there's something there
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumb er(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2753171
System.Number.ParseDecimal (String value, NumberStyles options, NumberFormatInfo numfmt) +119
System.Decimal.Parse(Strin g s, NumberStyles style, IFormatProvider provider) +37
System.Convert.ToDecimal(S tring value, IFormatProvider provider) +50
System.String.System.IConv ertible.To Decimal(IF ormatProvi der provider) +10
System.Convert.ChangeType( Object value, TypeCode typeCode, IFormatProvider provider) +495
System.Web.UI.WebControls. Parameter. GetValue(O bject value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +264
System.Web.UI.WebControls. SqlDataSou rceView.Ad dParameter s(DbComman d command, ParameterCollection reference, IDictionary parameters, IDictionary exclusionList, String oldValuesParameterFormatSt ring) +557
System.Web.UI.WebControls. SqlDataSou rceView.Ex ecuteUpdat e(IDiction ary keys, IDictionary values, IDictionary oldValues) +369
System.Web.UI.DataSourceVi ew.Update( IDictionar y keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCal lback callback) +78
System.Web.UI.WebControls. DetailsVie w.HandleUp date(Strin g commandArg, Boolean causesValidation) +1152
System.Web.UI.WebControls. DetailsVie w.HandleEv ent(EventA rgs e, Boolean causesValidation, String validationGroup) +461
System.Web.UI.WebControls. DetailsVie w.OnBubble Event(Obje ct source, EventArgs e) +95
System.Web.UI.Control.Rais eBubbleEve nt(Object source, EventArgs args) +35
System.Web.UI.WebControls. DetailsVie wRow.OnBub bleEvent(O bject source, EventArgs e) +109
System.Web.UI.Control.Rais eBubbleEve nt(Object source, EventArgs args) +35
System.Web.UI.WebControls. Button.OnC ommand(Com mandEventA rgs e) +115
System.Web.UI.WebControls. Button.Rai sePostBack Event(Stri ng eventArgument) +163
System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument) +7
System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData) +33
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +5102
System.Number.StringToNumb
System.Number.ParseDecimal
System.Decimal.Parse(Strin
System.Convert.ToDecimal(S
System.String.System.IConv
System.Convert.ChangeType(
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.DataSourceVi
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Control.Rais
System.Web.UI.WebControls.
System.Web.UI.Control.Rais
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
Where are you setting this parameter?
<asp:Parameter Name="ID" Type="Decimal" />
<asp:Parameter Name="ID" Type="Decimal" />
ASKER
It's part of the keynames collection and is bound to a hidden field .
However, i have actually attempted to set the ID parameter with no effect.
However, i have actually attempted to set the ID parameter with no effect.
ASKER
I'm wondering if there is a more effective way of debugging this.
Is there a utility or setting i can use to help identify which field the Update is failing on?
Is there a utility or setting i can use to help identify which field the Update is failing on?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I noticed that myself...This is my first expierence with bound controls. I usually encode all this myself and in fact use int32.
Maybe i'll try that?
Maybe i'll try that?
Can you post the code of the stored procedure itself?
I suspect possibly it's the Session("RegID") part is coming back as an object and can't be implicitly cast to a decimal.
Try replacing with a hard coded value and see if it starts working (would narrow down to that parameter) or else try casting Session("RegID") to a decimal value.