首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

F5运作一点错没有 , .exe打开就有错 ,

2013-02-24 
F5运行一点错没有, .exe打开就有错 ,............************** 异常文本 **************System.NullRefe

F5运行一点错没有 , .exe打开就有错 ,............
************** 异常文本 **************
System.NullReferenceException: 未将对象引用设置到对象的实例。
   在 DB.GetSqlCon() 位置 E:\应用\DormManageSystemfinal\app_code\DB.cs:行号 30
   在 DB.GetDataTable(String sql) 位置 E:\应用\DormManageSystemfinal\app_code\DB.cs:行号 73
   在 DormManageSystem.AddStudent.comboBox_lou_SelectedIndexChanged(Object sender, EventArgs e) 位置 E:\应用\DormManageSystemfinal\AddStudent.cs:行号 89
   在 System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
   在 System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   在 System.Windows.Forms.ComboBox.WndProc(Message& m)
   在 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)


F5运行一点错没有  , .exe打开就有错 ,啥情况
[解决办法]
确保exe目录下有你程序名称的config文件?
[解决办法]

引用:
引用:确保exe目录下有你程序名称的config文件?

这有什么关系,没明白.

string ConString = System.Configuration.ConfigurationManager.ConnectionStrings["dormmanageConnectionString"].ConnectionString;//从config文件里取值,没找到config文件当然报错了

热点排行