473,396 Members | 2,011 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,396 software developers and data experts.

Targetinvocationexception

Hi, I have a dropdown box bound to a data object. In the code below I am
trying to bind this dropdown box to a different dataobject called
ObjDtaSceSystemBySystemType but get the error (Target invocation exception)
when I try to bind the dropdown box to the new dataobject. Any IDEAS!

ObjDtaSceSystemBySystemType.SelectParameters["SystemTypeID"].DefaultValue =
Convert.ToString(drdwnSystemtype.SelectedValue);
ObjDtaSceSystemBySystemType.DataBind();
drdwnSystem.Items.Clear();
drdwnSystem.DataSourceID = "ObjDtaSceSystemBySystemType";
drdwnSystem.DataBind();

Below is the detailed error information.

System.Reflection.TargetInvocationException was unhandled by user code
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._InvokeMethodFast(Objec t target,
Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
Object[] arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at
System.Web.UI.WebControls.ObjectDataSourceView.Inv okeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
at
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteSelect(DataSourceSelectArguments arguments)
at System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs e)
at System.Web.UI.WebControls.ListControl.PerformSelec t()
at System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind()
at InspectionsNew.drdwnSystemtype_SelectedIndexChange d(Object sender,
EventArgs e) in
c:\Inetpub\wwwroot\ALLQSISREALDATA\SQSIS\frmInspec tionsNew.aspx.cs:line 235
at
System.Web.UI.WebControls.ListControl.OnSelectedIn dexChanged(EventArgs e)
at System.Web.UI.WebControls.DropDownList.RaisePostDa taChangedEvent()
at
System.Web.UI.WebControls.DropDownList.System.Web. UI.IPostBackDataHandler.RaisePostDataChangedEvent( )
at System.Web.UI.Page.RaiseChangedEvents()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

--
Paul G
Software engineer.
Jun 27 '08 #1
2 2142
As if the method you have specified to be called for the ObjectdataSource
would throw an error....have you confirmed that calling this method as
stand-alone works? And how's he type that ODS instantiates? (see:
http://forum.springframework.net/showthread.php?t=1377 for discussion in bit
similar case as yours)

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:E9**********************************@microsof t.com...
Hi, I have a dropdown box bound to a data object. In the code below I am
trying to bind this dropdown box to a different dataobject called
ObjDtaSceSystemBySystemType but get the error (Target invocation
exception)
when I try to bind the dropdown box to the new dataobject. Any IDEAS!

ObjDtaSceSystemBySystemType.SelectParameters["SystemTypeID"].DefaultValue
=
Convert.ToString(drdwnSystemtype.SelectedValue);
ObjDtaSceSystemBySystemType.DataBind();
drdwnSystem.Items.Clear();
drdwnSystem.DataSourceID = "ObjDtaSceSystemBySystemType";
drdwnSystem.DataBind();

Below is the detailed error information.

System.Reflection.TargetInvocationException was unhandled by user code
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._InvokeMethodFast(Objec t target,
Object[] arguments, SignatureStruct& sig, MethodAttributes
methodAttributes,
RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
Object[] arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at
System.Web.UI.WebControls.ObjectDataSourceView.Inv okeMethod(ObjectDataSourceMethod
method, Boolean disposeInstance, Object& instance)
at
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteSelect(DataSourceSelectArguments
arguments)
at System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs e)
at System.Web.UI.WebControls.ListControl.PerformSelec t()
at System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind()
at InspectionsNew.drdwnSystemtype_SelectedIndexChange d(Object
sender,
EventArgs e) in
c:\Inetpub\wwwroot\ALLQSISREALDATA\SQSIS\frmInspec tionsNew.aspx.cs:line
235
at
System.Web.UI.WebControls.ListControl.OnSelectedIn dexChanged(EventArgs e)
at
System.Web.UI.WebControls.DropDownList.RaisePostDa taChangedEvent()
at
System.Web.UI.WebControls.DropDownList.System.Web. UI.IPostBackDataHandler.RaisePostDataChangedEvent( )
at System.Web.UI.Page.RaiseChangedEvents()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

--
Paul G
Software engineer.

Jun 27 '08 #2
Thanks for the response. I was able to get it to work, first set the
datasourceid = null then just set the datasource to the new object and then
the databind. After this I still had the same error, but noticed that the
stored procedure did not have execute permissions, after changing this it
works!
--
Paul G
Software engineer.
"Teemu Keiski" wrote:
As if the method you have specified to be called for the ObjectdataSource
would throw an error....have you confirmed that calling this method as
stand-alone works? And how's he type that ODS instantiates? (see:
http://forum.springframework.net/showthread.php?t=1377 for discussion in bit
similar case as yours)

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:E9**********************************@microsof t.com...
Hi, I have a dropdown box bound to a data object. In the code below I am
trying to bind this dropdown box to a different dataobject called
ObjDtaSceSystemBySystemType but get the error (Target invocation
exception)
when I try to bind the dropdown box to the new dataobject. Any IDEAS!

ObjDtaSceSystemBySystemType.SelectParameters["SystemTypeID"].DefaultValue
=
Convert.ToString(drdwnSystemtype.SelectedValue);
ObjDtaSceSystemBySystemType.DataBind();
drdwnSystem.Items.Clear();
drdwnSystem.DataSourceID = "ObjDtaSceSystemBySystemType";
drdwnSystem.DataBind();

Below is the detailed error information.

System.Reflection.TargetInvocationException was unhandled by user code
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._InvokeMethodFast(Objec t target,
Object[] arguments, SignatureStruct& sig, MethodAttributes
methodAttributes,
RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
Object[] arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at
System.Web.UI.WebControls.ObjectDataSourceView.Inv okeMethod(ObjectDataSourceMethod
method, Boolean disposeInstance, Object& instance)
at
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteSelect(DataSourceSelectArguments
arguments)
at System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs e)
at System.Web.UI.WebControls.ListControl.PerformSelec t()
at System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind()
at InspectionsNew.drdwnSystemtype_SelectedIndexChange d(Object
sender,
EventArgs e) in
c:\Inetpub\wwwroot\ALLQSISREALDATA\SQSIS\frmInspec tionsNew.aspx.cs:line
235
at
System.Web.UI.WebControls.ListControl.OnSelectedIn dexChanged(EventArgs e)
at
System.Web.UI.WebControls.DropDownList.RaisePostDa taChangedEvent()
at
System.Web.UI.WebControls.DropDownList.System.Web. UI.IPostBackDataHandler.RaisePostDataChangedEvent( )
at System.Web.UI.Page.RaiseChangedEvents()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

--
Paul G
Software engineer.


Jun 27 '08 #3

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

Similar topics

4
by: dudi | last post by:
Hi, very puzzling... I have one perfectly working solution, in which I use a a.dll which has a class A. that class loads data from the database and for each row deserialize the cell into class A1....
1
by: Greg Patrick | last post by:
My problem: I load an some assemblies (strong named) from a byte array using Assembly.Load(byte). They load fine. But one one of them is actually accessed, it's referenced assemblies can't be...
7
by: dudi | last post by:
Hi, very puzzling... I have one perfectly working solution, in which I use a a.dll which has a class A. that class loads data from the database and for each row deserialize the cell into class A1....
4
by: dudi | last post by:
Hi, very puzzling... I have one perfectly working solution, in which I use a a.dll which has a class A. that class loads data from the database and for each row deserialize the cell into class A1....
2
by: Zytan | last post by:
I just got a TargetInvocationException from a WebBrowser control, after calling WebBrowser.Document.Write(text), which (internally) calls System.Windows.Forms.HtmlDocument.Write(String text),...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
Oralloy
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,...
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
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.