[英]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.