I'm getting the following error when I try and insert a row using FormView,
ObjectDataSource and stored procedure. The form has 40+ columns on it and I'm
not sure how to diagnose where the problem is, the data object class, the
business class etc?
Object of type 'System.Int32' cannot be converted to type 'System.String'.
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.ArgumentException: Object of type 'System.Int32'
cannot be converted to type 'System.String'.
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:
[ArgumentException: Object of type 'System.Int32' cannot be converted to
type 'System.String'.]
System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object
component, Object value) +357
System.Web.UI.WebControls.ObjectDataSourceView.Bui ldDataObject(Type
dataObjectType, IDictionary inputParameters) +237
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary
values) +270
System.Web.UI.DataSourceView.Insert(IDictionary values,
DataSourceViewOperationCallback callback) +72
System.Web.UI.WebControls.FormView.HandleInsert(St ring commandArg,
Boolean causesValidation) +388
System.Web.UI.WebControls.FormView.HandleEvent(Eve ntArgs e, Boolean
causesValidation, String validationGroup) +623
System.Web.UI.WebControls.FormView.OnBubbleEvent(O bject source, EventArgs
e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.FormViewRow.OnBubbleEven t(Object source,
EventArgs e) +109
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnCommand(Com mandEventArgs e) +115
System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String
eventArgument) +163
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Anu suggestions on how to diagnose this would be appreciated.
Thanks much. 2 1843
I think that this line of the error message
[System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object
component, Object value) +357] is telling you is that a type-casting error
occured while attempting to set a public property in your BLL that is int32
with a value that is of type string. I would suggest that you have the type
specified in all of your update parameter, .e.g
<asp:Parameter Name="PK_ID" Type="Int32" />
--
HTH,
Phillip Williams http://www.societopia.net http://www.webswapp.com
"Dabbler" wrote: I'm getting the following error when I try and insert a row using FormView, ObjectDataSource and stored procedure. The form has 40+ columns on it and I'm not sure how to diagnose where the problem is, the data object class, the business class etc?
Object of type 'System.Int32' cannot be converted to type 'System.String'. 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.ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'.
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:
[ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'.] System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object component, Object value) +357 System.Web.UI.WebControls.ObjectDataSourceView.Bui ldDataObject(Type dataObjectType, IDictionary inputParameters) +237 System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary values) +270 System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +72 System.Web.UI.WebControls.FormView.HandleInsert(St ring commandArg, Boolean causesValidation) +388 System.Web.UI.WebControls.FormView.HandleEvent(Eve ntArgs e, Boolean causesValidation, String validationGroup) +623 System.Web.UI.WebControls.FormView.OnBubbleEvent(O bject source, EventArgs e) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.FormViewRow.OnBubbleEven t(Object source, EventArgs e) +109 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.LinkButton.OnCommand(Com mandEventArgs e) +115 System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String eventArgument) +163
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +174 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Anu suggestions on how to diagnose this would be appreciated.
Thanks much.
Thanks much Phillip that did the trick, I had omitted some insert parameters
after revising the form.
"Phillip Williams" wrote: I think that this line of the error message [System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object component, Object value) +357] is telling you is that a type-casting error occured while attempting to set a public property in your BLL that is int32 with a value that is of type string. I would suggest that you have the type specified in all of your update parameter, .e.g <asp:Parameter Name="PK_ID" Type="Int32" />
-- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Dabbler" wrote:
I'm getting the following error when I try and insert a row using FormView, ObjectDataSource and stored procedure. The form has 40+ columns on it and I'm not sure how to diagnose where the problem is, the data object class, the business class etc?
Object of type 'System.Int32' cannot be converted to type 'System.String'. 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.ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'.
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:
[ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'.] System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object component, Object value) +357 System.Web.UI.WebControls.ObjectDataSourceView.Bui ldDataObject(Type dataObjectType, IDictionary inputParameters) +237 System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary values) +270 System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +72 System.Web.UI.WebControls.FormView.HandleInsert(St ring commandArg, Boolean causesValidation) +388 System.Web.UI.WebControls.FormView.HandleEvent(Eve ntArgs e, Boolean causesValidation, String validationGroup) +623 System.Web.UI.WebControls.FormView.OnBubbleEvent(O bject source, EventArgs e) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.FormViewRow.OnBubbleEven t(Object source, EventArgs e) +109 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.LinkButton.OnCommand(Com mandEventArgs e) +115 System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String eventArgument) +163
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +174 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Anu suggestions on how to diagnose this would be appreciated.
Thanks much. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Stuart Ferguson |
last post by:
I am currently experimenting with the FormView control using an
ObjectDataSource, i have got the select section of the form view control
working fine however when it comes to using the formview to...
|
by: Lorenzino |
last post by:
Hi, I have a problem with bindings in a formview.
I have a formview; in the insert template i've created a wizard control and
inside
it i have an HTML table with some textboxes bound to the...
|
by: Chris |
last post by:
I have a formview based on an SQL Data Source see below. I have a formview
bound to it. The item insert template has a command button with a command
name insert. When I press it the insert doesn't...
|
by: Prakash |
last post by:
Hi all,
I am getting an error message "Object reference not set to an instance
of an object." when i try to read values that are inside FormView
control. I am just trying to read the values...
|
by: Bishop |
last post by:
ASP.NET 2.0
XP SP2
IIS
W/IE7
Master Page
I use the wizard to create the FormView and Datasource and set the default
view to Insert. When I try to use the page, and click the insert link, I...
|
by: AG |
last post by:
ASP.NET 2.0 aspx page with a FormView bound to an ObjectDataSource to view,
add and edit records.
Can anyone point me to a sample of how to retain the user entered control
values when an insert...
|
by: =?Utf-8?B?QXNo?= |
last post by:
Hi,
I have an object, for example User. User contains various properties which i
have been able to bind to successfully using wizards and the form view.
However if the class User has a property...
|
by: Enigma Boy |
last post by:
Hi Folks,
If I bind my formview to a dataset business object all works well, but when
I bind it to my own custom class business object it refreshes on each
postback. I am trying to do an insert...
|
by: yosri2005 |
last post by:
Hello,
I'm sure many of you have seen the error message in the subject. I
found quiet a few posts on the web regarding this issue, but the ones
I saw mainly tackle this issue when you have a...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |