Answered by:
How to debug this...

Question
-
User-239001081 posted
Hi there,
Trying to customize Formview Insert Template I am getting the following error page while browsing the page. How can I find the source of the error ???
Failed to set one or more properties on type property. is not a valid value for Int16.
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.Web.UI.WebControls.LinqDataSourceValidationException: Failed to set one or more properties on type property. is not a valid value for Int16.
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:
[LinqDataSourceValidationException: Failed to set one or more properties on type property. is not a valid value for Int16.] System.Web.UI.WebControls.LinqDataSourceView.HandleValidationErrors(IDictionary`2 errors, DataSourceOperation operation) +622 System.Web.UI.WebControls.QueryableDataSourceView.ExecuteInsert(IDictionary values) +153 System.Web.UI.WebControls.ContextDataSourceView.ExecuteInsert(IDictionary values) +161 System.Web.UI.WebControls.LinqDataSourceView.ExecuteInsert(IDictionary values) +51 System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +100 System.Web.UI.WebControls.FormView.HandleInsert(String commandArg, Boolean causesValidation) +364 System.Web.UI.WebControls.FormView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +621 System.Web.UI.WebControls.FormView.OnBubbleEvent(Object source, EventArgs e) +89 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.FormViewRow.OnBubbleEvent(Object source, EventArgs e) +82 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +161 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9754214 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3562
Sunday, July 24, 2016 6:52 AM
Answers
-
User283571144 posted
Hi shtrudel,
Trying to customize Formview Insert Template I am getting the following error page while browsing the page. How can I find the source of the error ???As far as I know, I suggest you could use debug tool in VS to find out which line has mistake.
More details, you could refer to follow link:
https://msdn.microsoft.com/en-us/library/5w9dfyd8.aspx
Best Regards,
Brando
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, July 24, 2016 12:20 PM
All replies
-
User283571144 posted
Hi shtrudel,
Trying to customize Formview Insert Template I am getting the following error page while browsing the page. How can I find the source of the error ???As far as I know, I suggest you could use debug tool in VS to find out which line has mistake.
More details, you could refer to follow link:
https://msdn.microsoft.com/en-us/library/5w9dfyd8.aspx
Best Regards,
Brando
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, July 24, 2016 12:20 PM -
User475983607 posted
From the MSDN LinqDataSourceValidationException reference documents.
Describes an exception that occurred during validation of new or modified values before values are inserted, updated, or deleted by a LinqDataSourcecontrol.The error indicates the property expected an int16 but an empty string was supplied.
Failed to set one or more properties on type property. [Blank] is not a valid value for Int16.
To debug, I would look at any user inputs and database values, You might have bad data in a database table.
Sunday, July 24, 2016 1:45 PM