Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception thrown by the target of an invocation

Status
Not open for further replies.

vatawna

Programmer
Feb 24, 2004
67
US
After writing a stored procedure and running the program, I got the error message "Exception has been thrown by the target of an invocation.". Then the Visual Studio .Net doesn't work correctly after that. I can't open the windows forms either in the design or editing view.

The website support.microsoft.com said this is caused by "deserializing an empty TimeSpan class in a DataSet collection". Does anyone know what this means or how to fix this?

Thanks.
 
Sorry, kneejnick. Actually, I don't know where the error is invoked from, so I didn't know what to describe about the problem. Let's try it again.

Currently, I have 2 windows projects in the solution. Project1 is for the login, project2 the report. If the user logs in successfully, the login form in project1 then invokes the report form in project2 with the following statements:

AppDomain loginDomain = AppDomain.CreateDomain("ReportProcessAssembly");

loginDomain.SetData("Username", loginRow["Username"].ToString());
loginDomain.SetData("UserPassword", loginRow["UserPassword"].ToString());
loginDomain.SetData("UserType", loginRow["UserType"]);

loginDomain.ExecuteAssembly("ReportProcess.exe");
this.Hide();


The report form receives the data set by the login form with the following statements:

reportDomain = AppDomain.CurrentDomain;
userType = (int)reportDomain.GetData("UserType");


Then in the Dispose method of the report form, the current domain disposes itself as follows:

AppDomain.Unload(reportDomain);


The error is probably not from the stored procedure that was called from the login form to pass data back to the report form. It's probably from creating another domain and exception is not caught. But I ran the application many times before that, nothing happened, until I changed the stored procedure.

Anyway, whenever I open Visual Studio .Net, the mouse cursor is jittering, indicating that some background process is still running. I can't open the files in design mode, but still can run the application OK.

Do you know how to fix this?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top