Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
144 views
in Technique[技术] by (71.8m points)

c# - Windows phone 8.1 can't reference System.Data

I'm trying to create a windows phone 8.1 apllication which has access to a local Database. I want to handle the DB acess in a portable class library. For introduction I looked as this webpage: https://msdn.microsoft.com/de-de/library/windows/apps/hh202876(v=vs.105).aspx

But I can't even reference the required namespaces:

using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.ComponentModel;
using System.Collections.ObjectModel;

And also I can't add none of them as reference. Can someone tell me whats wrong

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can not use SqlClient in PCL projects because it is not built as a PCL and it is not cross platform. The Data namespace is unavailable in PCL projects and it is not listed here.

The following assemblies are available within a Portable Class Library project:

  • mscorlib.dll
  • System.dll
  • System.Core.dll
  • System.Xml.dll
  • System.ComponentModel.Composition.dll
  • System.Net.dll
  • System.Runtime.Serialization.dll
  • System.ServiceModel.dll
  • System.Xml.Serialization.dll
  • System.Windows.dll (from Silverlight)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...