SOS,高分请教一个问题,DataTable dt=new DataTable()语句也出错
我在程序中访问数据库的时候写了如下的代码:
System.Data.DataTable dt = new System.Data.DataTable();
string sql = @" SELECT Top 1"
+ " OA_FlowsTrace.* "
+ " ,(Select Top 1 NodeName From OA_Nodes Where OA_Nodes.Guid in(Select Top 1 OA_FlowsNode.NodeGuid From OA_FlowsNode Where OA_FlowsNode.Guid = OA_FlowsTrace.FlowsNodeGuid )) As NodeName "
+ " ,(Select Top 1 UserID From [SysUser] Where SysUser.Guid = OA_FlowsTrace.UserGuid) As UserID "
+ " ,(Select Top 1 Guid From [OA_Flows] Where OA_Flows.Guid = (Select Top 1 OA_FlowsNode.FlowGuid From OA_FlowsNode Where OA_FlowsNode.Guid = OA_FlowsTrace.FlowsNodeGuid)) As FlowsGuid "
+ " from OA_FlowsTrace Where WorkGuid='" + strWorkGuid + "'";
this.InitDataSetTableBySQL(ref dtOA_FlowsTrace, sql);
using (SqlConnection conn = new SqlConnection("Server=192.168.15.89;uid=sa;pwd=123;DataBase=OA;"))
{
SqlCommand command = conn.CreateCommand();
command.CommandText = sql;
SqlDataAdapter adapter = new SqlDataAdapter(command);
adapter.Fill(dt);
}
return dt;
当我设置断点调试的时候,运行到DataTable dt=new DataTable(),就报错误了,错误提示框如下:
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。
************** 异常文本 **************
System.Exception: 由于线程停在某个无法进行垃圾回收的点(可能是因为已对代码进行了优化),因此无法计算表达式的值。
在 Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
在 Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy)
************** 已加载的程序集 **************
mscorlib
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.3603 (GDR.050727-3600)
基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Microsoft.VisualStudio.CommonIDE
程序集版本: 8.0.0.0
Win32 版本: 8.0.50727.762
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.CommonIDE/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.CommonIDE.dll
----------------------------------------
Microsoft.VisualStudio.DebuggerVisualizers
程序集版本: 8.0.0.0
Win32 版本: 8.0.50727.42
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.DebuggerVisualizers/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.DebuggerVisualizers.dll
----------------------------------------
System.Windows.Forms
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Windows.Forms.resources
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。
例如:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。
请各位帮忙,我烦恼啊!!!