ADO在类或命名空间中不存在 [英] ADO does not exist in class or namespace

查看:94
本文介绍了ADO在类或命名空间中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是C#的新手,正在通过写简单的联系

经理课程来练习这门语言。我在使用ADO时遇到问题。我正在尝试使用ADO.Net将

连接到Access 2000数据库。编译时我得到

以下错误:

类或命名空间名称''ADO''在类或命名空间中不存在

''系统'')你是否缺少程序集引用?)


我已经包含了''使用System.Data.ADO''命名空间,尽管当我键入

''使用System.Data。''部分我只获得了这些课程

''Common'',''OleDb'',''SqlClient''和下拉列表中的SqlTypes。 ''ADO''

不是列表选项之一。


我正在使用MS Visual Studio 2002 - 1.0框架。 />

我做错了吗? - 请帮助!!


非常感谢,

Jon。


-

通过DotNetMonster.com发布的消息
http://www.dotnetmonster.com/Uwe/For...sharp/200505/1

Hi all,

I''m new to C# and am practising the language by writing simple contact
manager programmes. I''m having a problem using ADO. I''m trying to connect
to an Access 2000 database using ADO.Net. When compiling I''m getting the
following error :
The type or namespace name ''ADO'' does not exist in the class or namespace
''System'')are you missing an assembly reference?)

I''ve included the ''using System.Data.ADO'' namespace, although when I typed
the ''using System.Data.'' part I only got the classes
''Common'',''OleDb'',''SqlClient'' and ''SqlTypes'' in the drop-down list. ''ADO''
wasn''t one of the list options.

I''m using MS Visual Studio 2002 - 1.0 framework.

Am I doing somthing wrong?? - PLEASE HELP!!

Many thanks,
Jon.

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200505/1

推荐答案



" Jon Smith via DotNetMonster.com" < FO *** @ nospam.DotNetMonster.com>写在

消息新闻:ce ****************************** @ DotNetMonste r.com。 ..

"Jon Smith via DotNetMonster.com" <fo***@nospam.DotNetMonster.com> wrote in
message news:ce******************************@DotNetMonste r.com...
大家好,

我是C#的新手,正在编写简单的联系
经理程序来练习这门语言。我在使用ADO时遇到问题。我正在尝试使用ADO.Net连接到Access 2000数据库。在编译时我得到以下错误:
类或命名空间名称''ADO''在类或命名空间中不存在
''系统'')你遗失了吗?汇编引用?)

我已经包含了''using System.Data.ADO''命名空间,尽管当我输入''using System.Data。''部分时我只在下拉列表中获得了类'
''Common'',''OleDb'',''SqlClient''和''SqlTypes''。 ''ADO''
不是列表选项之一。

我正在使用MS Visual Studio 2002 - 1.0框架。

我是做错了什么? - 请帮助!!

非常感谢,
Jon。

-
通过DotNetMonster.com发布的消息
http://www.dotnetmonster.com/Uwe/For。 ..sharp / 200505/1




您是否尝试使用ADO或ADO.NET?你似乎正在寻找两个人的混合价格,因为你引用了一些ADO.NET类,但你说你是在寻找ADO的
;。

如果你正在开发的应用程序有一个接口,试试这个:使用服务器

资源管理器建立与Access数据库的连接。然后在Server Explorer中显示

表并将表拖到您的界面。那应该是

自动为你创建一个OleDbConnection对象。

您可能还想参考MSDN中有关ADO.NET的众多文章

帮助,例如.NET示例 - 如何:数据和ADO.NET;和访问数据

使用ADO.NET。


-

Peter [MVP Visual Developer]
所有行业的杰克,无人掌握。



Are you trying to use ADO or ADO.NET? You seem to be looking for a mix of
the two, as you refer to some of the ADO.NET classes, yet you say you are
looking for "ADO".
If the application you''re developing has an interface, try this: use Server
Explorer to establish a connection to your Access database. Then display the
tables in Server Explorer and drag a table to your interface. That should
automatically create an OleDbConnection object for you.
You may also want to refer to the numerous articles on ADO.NET in your MSDN
Help, such as ".NET Samples - How To: Data and ADO.NET" and "Accessing Data
With ADO.NET".

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.


嗨彼得,


感谢您的回复。 />

我正在尝试使用ADO.Net,因为我正在使用VS.Net。我真的很想坚持使用

ADO.Net原因是我实际上是在关注如何将DataBind文本框发送到数据的下面的网站'



http ://www.mastercsharp.com/article....D=4&& TopicID = 8


这是编译后的错误信息那个说''ADO''而不是

''ADO.Net''。我想它只是说''ADO'',因为这是我输入的名称空间
即使用System.Data.ADO


各种互联网网站准确地说出以上是网站如何使用ADO.Net连接到数据库的b $ b $。虽然由于某种原因,当我尝试时会发生编译

错误。


谢谢,

Jon。


-

通过DotNetMonster.com发布消息
http://www.dotnetmonster.com/Uwe/For...sharp/200505/1
Hi Peter,

Thanks for replying.

I''m trying use ADO.Net as I''m using VS.Net. I really want to stick with
ADO.Net the reason being is I''m actually following the below site''s
information on how to DataBind a textbox to Data.

http://www.mastercsharp.com/article....D=4&&TopicID=8

It''s actually the error message, after compiling, that says ''ADO'' and not
''ADO.Net''. I guess it only says ''ADO'' as this is the namespace I''ve
entered i.e. using System.Data.ADO

Various internet sites say exactly what the above is site says in how to
connect to a database using ADO.Net. Although for some reason a compile
error occurs when I try.

Thanks,
Jon.

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200505/1


听起来你只需要添加参考即可。到你的

项目的System.Data。仅使用声明是不够的。

-

Thom

Jon Smith通过DotNetMonster.com写道:
Sounds like you just need to add the "Reference" to System.Data to your
project. The using statement alone is not enough.
--
Thom
"Jon Smith via DotNetMonster.com" wrote:
大家好,

我是C#的新手,正在编写简单的联系
经理程序来练习这门语言。我在使用ADO时遇到问题。我正在尝试使用ADO.Net将
连接到Access 2000数据库。在编译时我得到以下错误:
类或命名空间名称''ADO''在类或命名空间中不存在
''系统'')你遗失了吗?汇编引用?)

我已经包含了''using System.Data.ADO''命名空间,尽管当我输入''using System.Data。''部分时我只在下拉列表中获得了类'
''Common'',''OleDb'',''SqlClient''和''SqlTypes''。 ''ADO''
不是列表选项之一。

我正在使用MS Visual Studio 2002 - 1.0框架。

我是做错了什么? - 请帮助!!

非常感谢,
Jon。

-
通过DotNetMonster.com发布的消息
http://www.dotnetmonster.com/Uwe/For。 ..sharp / 200505/1



这篇关于ADO在类或命名空间中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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