VS2010 调试环境下连接SQL,提取数据都正常,,方案生成以后,为什么所有连接SQL的地方都是未将对象引用设置到实例,郁闷那,是不是少什么动态库了
sql连接地址如果有改变的话,检查连接字符串.
方案生成是什么意思?换电脑了?还是换运行目录了?
如果调试环境下链接SQL正常,问题就不大。
没有换电脑,生成后直接运行的exe,和VS项目不在同一个目录。数据库连接字符串一样。意思就是离开VS开发环境后除了这个提示
看下你的代码,,截个图
System.NullReferenceException: 未将对象引用设置到对象的实例。
在 BSoft.Core.SqlDataAccess.DoExecuteDataTable(DbCommand command)
在 BSoft.Core.SqlDataAccess.ExecuteDataTable(String commandText, CommandType commandType)
在 System.Windows.Forms.Form.OnLoad(EventArgs e)
在 DevExpress.XtraEditors.XtraForm.OnLoad(EventArgs e)
在 System.Windows.Forms.Form.OnCreateControl()
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl()
在 System.Windows.Forms.Control.WmShowWindow(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WmShowWindow(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
BSoft.Core.SqlDataAccess 是软件的数据库设置 邪门了!