简体   繁体   中英

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. 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. 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。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM