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.