一个系统报错,看不懂什么意思!

musclecn 2008-04-23 03:23:41
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;
}
...全文
167 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
gui0605 2008-04-23
  • 打赏
  • 举报
回复
JS
musclecn 2008-04-23
  • 打赏
  • 举报
回复
谢谢 各位
EndFalse 2008-04-23
  • 打赏
  • 举报
回复
ConnectionString不允许修改当连接状态打开时
priwilliam 2008-04-23
  • 打赏
  • 举报
回复
连接串打开的时候不能修改 先conn.close()
zhnzzy 2008-04-23
  • 打赏
  • 举报
回复
Not allowed to change the 'ConnectionString' property while the connection (state=Open).
查查这个先

110,531

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧