一个系统报错,看不懂什么意思!
Exception has been thrown by the target of an invocaton
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Not allowed to change the 'ConnectionString' property while the connection (state=Open).
at System.Data.OleDb.OleDbConnection.set_ConnectionString(String value)
代码:
Form fm=loadfm();
fm.TopLevel=false;
this.Height=fm.Height;
this.Width=fm.Width;
this.Controls.Add(fm);
fm.Show();
Form loadfm()
{
AppDomainSetup ads = new AppDomainSetup();
ads.ShadowCopyFiles = "true";
AppDomain.CurrentDomain.SetShadowCopyFiles();
Evidence adevidence = AppDomain.CurrentDomain.Evidence;
AppDomain newDomain = AppDomain.CreateDomain("newDomain", adevidence, ads);
newDomain.SetShadowCopyFiles();
byte[] rawAssembly = loadFile(pjname);
Assembly assm = newDomain.Load(rawAssembly, null);
object[] args = new object[] {czlx};
object obj = assm.CreateInstance("htcn.piaoju.money", false, System.Reflection.BindingFlags.Default, null, args, null, null);
Form fm = null;
fm = (Form)obj;
return fm;
}