用单位的WIN2000做的程序,结果运行可执行文件报错(DEBUG调试也报错)
但是!!!我将可执行文件拷到我家里的WIN98机器中,就可以运行了(仅装了,NET Freamwork)
错误信息如下:
————————————————————————————————————————————
左上角:Microsoft .net 框架正文:应用程序中发生了未处理的异常。外部表不是预期的格式。。详细信息中内容如下:
————————————————————————————————————————————
有关调用实时 (JIT) 调试而不是此对话框的详细信息,
请参阅此消息的结尾。************** 异常文本 **************
System.Data.OleDb.OleDbException: 外部表不是预期的格式。
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.ExecuteReader()
at WindowsApplication3.Form1.button1_Click(Object sender, EventArgs e) in d:\windowsapplication3\form1.cs:line 241
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** 已加载的程序集 **************
mscorlib
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
WindowsApplication3
程序集版本:1.0.1945.33467
Win32 版本:1.0.1945.33467
基本代码:file:///D:/备份/c%23/程序/aaa/bin/Debug/WindowsApplication3.exe
----------------------------------------
System.Windows.Forms
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
System.Data
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Drawing
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.EnterpriseServices
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.enterpriseservices/1.0.3300.0__b03f5f7f11d50a3a/system.enterpriseservices.dll
----------------------------------------
System.Windows.Forms.resources
程序集版本:1.0.3300.0
Win32 版本:1.0.3300.0
基本代码:file:///c:/winnt/assembly/gac/system.windows.forms.resources/1.0.3300.0_zh-chs_b77a5c561934e089/system.windows.forms.resources.dll
----------------------------------------************** JIT 调试 **************
若要启用实时 (JIT) 调试,此
应用程序或计算机的配置文件 (machine.config) 的
system.windows.forms 节中必须设置 jitDebugging 值。
编译应用程序时还必须启用
调试。例如:<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>启用 JIT 调试后,任何未处理的异常
将被发送到此计算机上注册的 JIT 调试器,
而不是由此对话框处理。
但是!!!我将可执行文件拷到我家里的WIN98机器中,就可以运行了(仅装了,NET Freamwork)
错误信息如下:
————————————————————————————————————————————
左上角:Microsoft .net 框架正文:应用程序中发生了未处理的异常。外部表不是预期的格式。。详细信息中内容如下:
————————————————————————————————————————————
有关调用实时 (JIT) 调试而不是此对话框的详细信息,
请参阅此消息的结尾。************** 异常文本 **************
System.Data.OleDb.OleDbException: 外部表不是预期的格式。
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.ExecuteReader()
at WindowsApplication3.Form1.button1_Click(Object sender, EventArgs e) in d:\windowsapplication3\form1.cs:line 241
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** 已加载的程序集 **************
mscorlib
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
WindowsApplication3
程序集版本:1.0.1945.33467
Win32 版本:1.0.1945.33467
基本代码:file:///D:/备份/c%23/程序/aaa/bin/Debug/WindowsApplication3.exe
----------------------------------------
System.Windows.Forms
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
System.Data
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Drawing
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.EnterpriseServices
程序集版本:1.0.3300.0
Win32 版本:1.0.3705.0
基本代码:file:///c:/winnt/assembly/gac/system.enterpriseservices/1.0.3300.0__b03f5f7f11d50a3a/system.enterpriseservices.dll
----------------------------------------
System.Windows.Forms.resources
程序集版本:1.0.3300.0
Win32 版本:1.0.3300.0
基本代码:file:///c:/winnt/assembly/gac/system.windows.forms.resources/1.0.3300.0_zh-chs_b77a5c561934e089/system.windows.forms.resources.dll
----------------------------------------************** JIT 调试 **************
若要启用实时 (JIT) 调试,此
应用程序或计算机的配置文件 (machine.config) 的
system.windows.forms 节中必须设置 jitDebugging 值。
编译应用程序时还必须启用
调试。例如:<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>启用 JIT 调试后,任何未处理的异常
将被发送到此计算机上注册的 JIT 调试器,
而不是由此对话框处理。
debug都通不过那显然是程序代码由问题了framework号称不兼容98的,能跑起来并不说明问题。
2000下应该是你的数据库执行的时候的问题。
你在2000的源代码的bin 目录的Release下直接执行下,看是报什么样的错误
比如表:
a b ……
1 ?
2 ?
3 ?
4 ?
5 ?
……
屏幕上应该显示“a的和为15”,我将bin/debug文件夹拷到在98下,执行WindowsApplication3.exe结果就正常显示出来了数据库是DBF文件
1楼的错误是执行bin/debug/WindowsApplication3.exe而打开.NET用debug调试出错信息是:
未处理的“System.Data.OleDb.OleDbException”类型的异常出现在 system.data.dll 中