473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Object conversion error on insert with FormView and ObjectDataSour

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.
Apr 17 '06 #1
2 1844
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.

Apr 17 '06 #2

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.

Apr 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
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...
7
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...
1
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...
0
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...
2
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...
6
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...
8
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...
0
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
marktang
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.