简体   繁体   English

为什么该命令不能在Windows XP上运行?

[英]Why the command does not run on Windows XP?

I have a .NET 3.5 (C#) application, but interestingly it does not run on Windows XP , but on windows 7 works well. 我有一个.NET 3.5(C#)应用程序,但有趣的是它不能在Windows XP上运行,但在Windows 7上运行良好。 My code is : 我的代码是:

DataSet ds = new DataSet();

CmdData.FillDataSet(ref ds, "Select * from T_User");

bool admin = ds.Tables[0].Rows[0].Field<long>("Id") == 1;

The error occurs on the third line and show this window 错误发生在第三行并显示此窗口

在此处输入图片说明

Details error: 详细信息错误:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. System.IO.FileNotFoundException:无法加载文件或程序集'System.Data.DataSetExtensions,版本= 3.5.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089'或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。

When the following code to replace the third line, my app works without error : 当以下代码替换第三行时,我的应用程序正常运行, 没有错误

bool admin = ds.Tables[0].Rows[0].ItemArray[0].ToString().Equals("1");

I do not want to use this command because I need the name of the field. 我不想使用此命令,因为我需要该字段的名称。

您可能没有在xp机器上安装.net 3.5。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么此代码适用于Windows 7,但不适用于Windows XP? - Why does this code work on Windows 7, but doesn't on Windows XP? .NET 3.5(C#)应用程序无法在Windows XP Professional上运行 - .NET 3.5 (C#) application does not run on Windows XP Professional 为什么我的二进制文件可以在Windows 8上运行而不能在Windows 7上运行? - Why does my binary run on Windows 8 but not on Windows 7? 为什么System.Drawing.Image.GetPropertyItem在Windows XP / 2003上的行为与Windows 7相比有所不同 - Why does System.Drawing.Image.GetPropertyItem behave differently on Windows XP / 2003 compared to Windows 7 无法在Win XP机器上运行netsh命令 - Not able to run netsh command in Win XP machine .NET 4.0 Project不能在Windows XP上运行 - .NET 4.0 Project will not run on Windows xp 如何在Windows XP上以管理员身份运行其他应用程序 - How to run another app as administrator on Windows XP axAcroPDF在Windows XP上不显示PDF - axAcroPDF does not display PDF on windows XP 在Windows 7中成功计划和运行的任务无法在Windows XP中运行 - Task that successfully scheduled and ran in Windows 7 could not run in Windows XP 为什么 Windows Phone 8 模拟器不能在 Windows 8.1 中运行? - Why Windows Phone 8 emulator does not run in Windows 8.1?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM