468,747 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,747 developers. It's quick & easy.

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 1644
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Stuart Ferguson | last post: by
1 post views Thread by Chris | last post: by
2 posts views Thread by Bishop | last post: by
6 posts views Thread by AG | last post: by
8 posts views Thread by =?Utf-8?B?QXNo?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.