Compilier将无法识别DataSet对象。 [英] Compilier will not recognize DataSet object.

查看:44
本文介绍了Compilier将无法识别DataSet对象。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Compilier将无法识别DataSet对象。


正如您所看到的,是一个测试简单形式,没有

其他代码。我只是试图获得任何Aspx表单,以便
识别DataSet对象。你可以从代码中看到

我正在导入System.Data.SqlClient。我可以得到

DataReader,DataView和DataTable但Visual Studio

甚至不会在Intellisense上调出DataSet,更不用说了
编译它。我收到的消息是:需要参考

到程序集''System.Xml''包含已实现的

接口''System.Xml.Serialization.IXmlSerializable'' 。

在项目中添加一个。


但我不想要那个。我想要

System.Data.SqlClient中的那个。当我尝试使用
System.Data.oleDB时,会发生同样的事情。这是多么痛苦明显的一步我在这里缺少



谢谢,


Dave

Imports System.Data

Imports System.Data.SqlClient


公共类WebForm1

继承System.Web.UI。 Page

受保护的WithEvents DataSet1 As System.Data.DataSet

Private Sub Page_Load(ByVal sender As System.Object,

ByVal e As System。 EventArgs)处理MyBase.Load


''将用户代码置于此处初始化页面

Dim obj as dataset = new dataset()
< br $>
End Sub


结束班

解决方案




DataSet是一个类,它允许您在应用程序上存储数据

内存并对其进行操作。 DataSet由DataTables和Between

组成。填充DataTable可以使用SQLClient的DataAdapter,


如您所见,DataSet不是任何数据库的一部分命名空间它是全局的类

,使您能够存储数据,并且您可以决定表格的来源是什么。


DataSet可以作为XML文件处理。实际上它有XSD文件

(架构)设置表,字段,关系和其他元数据。

这就是DataSet需要引用System.XML的原因。


Natty Gur,首席技术官

Dao2Com Ltd.

28th Baruch Hirsch st。 Bnei-Brak

以色列,51114

电话号码:

办公室:+ 972-(0)3-5786668

传真:+ 972-(0)3-5703475

手机:+ 972-(0)58-888377


了解整体情况

***通过开发人员指南 http://www.developersdex发送。 com ***

不要只是参加USENET ......获得奖励!



我有VB.NET equivelent。


Imports System.Data

Imports System.Data.SqlClient

(其余代码位于页面底部。)


这就是困扰我的原因。我可以到达从名称空间暴露的其他

对象,例如DataReader,

DataView和DataTable。这是_just_DataSet将不会被识别。


Dave

--- - 原始消息-----

你有使用System.Data;在你的代码中有一个对System.Data.dll的引用?

-----原始消息-----
Compilier将无法识别DataSet对象。

正如您在下面看到的那样,是一个没有
其他代码的测试简单形式。我只是想获取任何Aspx表单来识别DataSet对象。您可以从导入System.Data.SqlClient的
codeI中看到。我可以使用DataReader,DataView和DataTable,但Visual Studio
甚至不会在Intellisense上启动DataSet,更不用说编译它了。我收到的消息是:参考需要
到程序集'System.Xml''包含已实现的
接口''System.Xml.Serialization.IXmlSerializable''。
添加一个你的项目。

但我不想要那个。我想要一个在System.Data.SqlClient中的那个。当我尝试使用System.Data.oleDB时,会发生同样的事情。我在这里失去了什么痛苦明显的一步?

谢谢,


Imports System.Data
进口系统.Data.SqlClient

公共类WebForm1
继承System.Web.UI.Page
受保护的WithEvents DataSet1 As System.Data.DataSet

Private Sub Page_Load(ByVal发送者为
System.Object,ByVal e As System.EventArgs)处理MyBase.Load

''用户代码初始化页面
Dim obj As dataset =新数据集()

End Sub

结束类




这确实很奇怪。添加

参考时会出现什么错误消息?


HTH,


Kevin Spencer

Microsoft FrontPage MVP

互联网开发人员
http ://www.takempis.com

大件物品由

很多小东西组成。


戴夫 < MI ******* @ hudnutt.com>在消息中写道

news:09 **************************** @ phx.gbl ... < blockquote class =post_quotes>

"那么,为什么不添加编译器要求你添加的




实际上,我试过了。添加''Imports System.Xml''
没有帮助。

你说得对,System.Data.SqlClient没有任何东西使用DataSet对象。这确实会让问题变得混乱。但是,我已经导入了
System.Data,这是我困惑的根源。为什么我(显然)从System.Data命名空间获取除了DataSet之外的所有其他对象和
方法?

谢谢,

Dave

-----原始消息-----
System.Data.SqlClient与DataSet没有关系。


DataSet不是

特定于提供者,因此它驻留在System.Data


NameSpace中。添加一个

对程序集的引用只会使你的应用程序


例如,添加一个引用


System.Data.SqlClient,我提到的

是没有必要的。那么,为什么不添加


编译器告诉你要添加的

的引用?

HTH,

Kevin Spencer
Microsoft FrontPage MVP
互联网开发人员
http ://www.takempis.com
大事由很多小东西组成。

戴夫 < MI ******* @ hudnutt.com>在消息中写道
新闻:09 **************************** @ phx.gbl ...


我想我明白你想说什么。但根据我所遇到的所有文档(Microsoft,Wrox Books等),DataSet表示DataSet是System.Data命名空间的一部分。我还导入了System.Data.SqlClient。 compilier和
Intellisense都会选择其他相关对象,例如DataReader,DataView,DataTable和其他许多对象。
为什么不使用DataSet?

Dave

> -----原始消息-----
>
>
> DataSet是一个允许您存储的类关于你的应用程序的数据
>记忆并操纵它。 DataSet由
DataTables和它们之间的关系
组成。填充DataTable可以使用DataAdapter
SQLClient,
> OLEDB,OracleClient或任何其他数据库连接
命名空间。
>
>如您所见DataSet不是任何数据库名称空间的一部分它是全局的类
>使您能够存储数据,并且您可以决定该表的来源是什么>
>
> DataSet可以作为XML处理文件。实际上它有XSD文件
>(架构)设置表,字段,关系和其他元数据。
>这就是DataSet需要引用的原因
System.XML。
>
> Natty Gur,首席技术官
> Dao2Com Ltd.
> 28th Baruch Hirsch st。 Bnei-Brak
>以色列,51114
>
>电话号码:
>办公室:+ 972-(0)3-5786668
>传真:+ 972-(0)3-5703475
>手机:+ 972-(0)58-888377
>
>了解整体情况
>
>
> ***通过开发人员指南 http:// www。 developersdex.com
***
>不要只是参加USENET ......获得奖励!
>。
>





Compilier will not recognize DataSet object.

As you can see below is from a test simple form with no
other code. I''m just trying to get any Aspx form to
recognize the DataSet object. You can see from the code
I am importing System.Data.SqlClient. I can get to
DataReader, DataView and DataTable but Visual Studio
won''t even bring up DataSet on Intellisense, much less
compile it. The message I get is: "Reference required
to assembly ''System.Xml'' containing the implemented
interface ''System.Xml.Serialization.IXmlSerializable''.
Add one to your project.

But I don''t want that one. I want the one in
System.Data.SqlClient. Same thing happens when I try
System.Data.oleDB. What painfully obvious step am I
missing here?

Thanks,

Dave
Imports System.Data
Imports System.Data.SqlClient

Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents DataSet1 As System.Data.DataSet
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

''Put user code to initialize the page here
Dim obj As dataset = New dataset()

End Sub

End Class

解决方案

Hi,

DataSet is a class that enables you to store data on your application
memory and manipulate it. DataSet is made from DataTables and Relations
between them. to Fill DataTable one can use DataAdapter of SQLClient,
OLEDB, OracleClient or any other DB connectivity namespace.

As you see DataSet is not part of any DB namespace it is "global" class
that enable you to store data and you can decide what is the source of
that Table.

The DataSet can be handling as XML file. Actually it got XSD file
(schema) that set the Tables, fields, relations and other Meta data.
That is the reason way DataSet need reference to System.XML.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



I have the VB.NET equivelent.

Imports System.Data
Imports System.Data.SqlClient
(rest of the code is at the bottom of the page.)

And that is what baffles me. I can get to the other
objects exposed from the namespace such as DataReader,
DataView and DataTable. It is _just_ DataSet that will
not get recognized.

Dave

-----Original Message-----

do you have "using System.Data;" in your code and have a
reference to System.Data.dll?

-----Original Message-----
Compilier will not recognize DataSet object.

As you can see below is from a test simple form with no
other code. I''m just trying to get any Aspx form to
recognize the DataSet object. You can see from the codeI am importing System.Data.SqlClient. I can get to
DataReader, DataView and DataTable but Visual Studio
won''t even bring up DataSet on Intellisense, much less
compile it. The message I get is: "Reference required
to assembly ''System.Xml'' containing the implemented
interface ''System.Xml.Serialization.IXmlSerializable''.
Add one to your project.

But I don''t want that one. I want the one in
System.Data.SqlClient. Same thing happens when I try
System.Data.oleDB. What painfully obvious step am I
missing here?

Thanks,

Dave
Imports System.Data
Imports System.Data.SqlClient

Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents DataSet1 As System.Data.DataSet
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load

''Put user code to initialize the page here
Dim obj As dataset = New dataset()

End Sub

End Class
.


.



That is indeed odd. What error message do you get when you add the
reference?

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"Dave" <mi*******@hudnutt.com> wrote in message
news:09****************************@phx.gbl...

"So, why don''t you just add the reference that


the compiler told you to add?"

Actually, I tried that. Adding ''Imports System.Xml''
doesn''t help.

You''re right though, System.Data.SqlClient doesn''t have
anything to do with the DataSet object. That does just
confuse the issue. However, I am already importing
System.Data and that is the source of my confusion. Why
am I (apparently) getting all the other objects and
methods available to me from the System.Data namespace
except for DataSet?

Thanks,

Dave

-----Original Message-----
System.Data.SqlClient has nothing to do with DataSets. A


DataSet is not

provider-specific, so it resides in the System.Data


NameSpace. Adding a

reference to the Assembly does nothing but make it


available to your app.

Case in point, adding a reference to


System.Data.SqlClient, which as I

mentioned, is not necessary. So, why don''t you just add


the reference that

the compiler told you to add?

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"Dave" <mi*******@hudnutt.com> wrote in message
news:09****************************@phx.gbl...


I think I understand what you''re trying to say. But
DataSet, according to all documention I''ve come across
(Microsoft, Wrox Books, etc.), says DataSet is part of
the System.Data namespace. I''ve also imported
System.Data.SqlClient. Both the compilier and
Intellisense pick up on other related objects such as
DataReader, DataView, DataTable and a host of others.
Why not DataSet?

Dave

>-----Original Message-----
>Hi,
>
>DataSet is a class that enables you to store data on
your application
>memory and manipulate it. DataSet is made from
DataTables and Relations
>between them. to Fill DataTable one can use DataAdapter
of SQLClient,
>OLEDB, OracleClient or any other DB connectivity
namespace.
>
>As you see DataSet is not part of any DB namespace it
is "global" class
>that enable you to store data and you can decide what is the source of
>that Table.
>
>The DataSet can be handling as XML file. Actually it got XSD file
>(schema) that set the Tables, fields, relations and
other Meta data.
>That is the reason way DataSet need reference to
System.XML.
>
>Natty Gur, CTO
>Dao2Com Ltd.
>28th Baruch Hirsch st. Bnei-Brak
>Israel , 51114
>
>Phone Numbers:
>Office: +972-(0)3-5786668
>Fax: +972-(0)3-5703475
>Mobile: +972-(0)58-888377
>
>Know the overall picture
>
>
>*** Sent via Developersdex http://www.developersdex.com
***
>Don''t just participate in USENET...get rewarded for it!
>.
>


.



这篇关于Compilier将无法识别DataSet对象。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆