请问在ASP.NET中有没有System.Data.ADO这个名字空间,100分求回复.

CrazySmall 2004-11-05 08:19:25
是这样的,小弟我刚刚入门,今天写的一个联接数据库的小程序,编译的时候,总是提示,如下:
编译器错误信息: CS0234: 类型或命名空间名称“ADO”在类或命名空间“System.Data”中不存在(是否缺少程序集引用?)
我联接的是ACESSE数据库.代码如下,请大家帮我找一下出错的原因.我也在帮助文档里搜索了一下,在文档也没找到System.Data.ADO. 但是我还是在有些书中看到有的例子中不是用了System.Date.ADO这个名字空间,我怎么也想不明白,所以特来请教高手.
<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
<Html>
<Form id="F1" Runat="Server">
请输入SQL 陈述: <Input Type="Text" Id="Text1" Runat="Server" >
<Button ID="Button1" Runat="Server" OnServerClick="Button1_Click">
执行
</Button>
</form>
<Span ID="Sp1" Runat="Server"/>
<Script Language="c#" Runat="Server">
void Button1_Click(object sender, EventArgs e)
{
ADOConnection cnA = new ADOConnection;
ADOCommand cmA = new ADOCommand;
cnA.Provider="Microsoft.Jet.OLEDB.4.0";
cnA.DataSource="e:/blue/MyWeb.mdb";//这是我的一个本地文件夹.
cnA.UserID="Admin";
cnA.Open();
cmA.ActiveConnection=cnA;
cmA.CommandType=CommandType.Text;
cmA.CommandText=Text1.Value;
cmA.Execute();
Sp1.InnerText="这个叙述影响了" + cmA.RecordsAffected + "笔资料";
}
</SCRIPT>
</Html>
...全文
110 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
m1seven 2004-11-10
  • 打赏
  • 举报
回复
懂了懂了...帮顶!
CrazySmall 2004-11-05
  • 打赏
  • 举报
回复
谢谢各位高手的指导,
dino2000 2004-11-05
  • 打赏
  • 举报
回复
access的为
<%@Import Namespace=System.Data.OleDb%>
sql的为
<%@Import Namespace=System.Data.SqlClient%>
fluxayxxx 2004-11-05
  • 打赏
  • 举报
回复
access的为
<%@Import Namespace=System.Data.OleDb%>
sql的为
<%@Import Namespace=System.Data.SqlClient%>
换本书吧
ianok 2004-11-05
  • 打赏
  • 举报
回复
ADO.NET: System.Data.OleDb、System.Data.SqlClient;
C#中: using System.Data.OleDb;
VB.NET中:Imports System.Data.OleDb
spgoal 2004-11-05
  • 打赏
  • 举报
回复
你的书太旧,用的BETA1版本的
WZCNet 2004-11-05
  • 打赏
  • 举报
回复
NET中没有System.Data.ADO名称空间,连接Access数据库你用System.Data.OleDb里的OleDb对象来操作吧。
OleDbConnection
OleDbCommand
OleDbAdapter
Leanderhe 2004-11-05
  • 打赏
  • 举报
回复
ADO.NET: System.Data.OleDb、System.Data.SqlClient;
C#中: using System.Data.OleDb;
VB.NET中:Imports System.Data.OleDb
cnhgj 2004-11-05
  • 打赏
  • 举报
回复
using System.Data.OleDb;

OleDbConnection Conn = new OleDbConnection("连接串");
OleDbCommand Cmd = new OleDbCommand("sql", Conn);
Conn.Open();
Cmd.ExecuteNonQuery();
Conn.Close();
luluso 2004-11-05
  • 打赏
  • 举报
回复
<%@Import Namespace=System.Data.ADO%>
这个命名空间己经没有了.
改成
access的为
<%@Import Namespace=System.Data.OleDb%>
sql的为

<%@Import Namespace=System.Data.SqlClient%>
cnhgj 2004-11-05
  • 打赏
  • 举报
回复
bate版里的吧?
Asp.Net技术文档
ADO.NET是微软的Microsoft ActiveX Data Objects (ADO)的下一代产品,是在微软的.NET创建分布式和数据共享应用程序的应用程序开发接口(API)。

ADO.NET能被用在任何用户的应用程序,需要和OLE DB-compliant的数据源连接和通讯,例如Microsoft SQL Server。

同时ADO.NET又保持着与以前的ADO模型有关的一些主要概念,它已经被极大的完善,并从不同的信息来源提供途径去获得结构化的数据----一个平台文本文件,从数据库管理系统获得的相关数据,或者是分级的XML数据----然而,所有都按照一个相容的,标准化的设计模型来执行。

这篇文章意在简要的介绍ADO.NET的关键特性,重点讲述了在关系数据库管理系统(rdbms)访问数据。

快速浏览

SQL Server 7.0(及更新版本)以及可以通过 OLE DB 提供者进行访问的任何数据源。这些又称为被管理的提供者(Managed Provider)。.NET框架的数据存取API提供了两种方式分别识别并处理两种类型的数据源:SQL Server 7.0(及更新版本)和可以通过 OLE DB 提供者进行访问的任何数据源。SQL(System.Data.SQL)库可以直接联结到SQL Server的数据,而ADO (System.Data.ADO)库可用于其他通过OLE DB 提供者进行访问的任何数据源。

SQL Server被管理的提供者在MS SQL Server 7.0或以后的版本使用叫做“tabulardata stream”的专用协议,而没有使用OLE DB, ADO 或 ODBC。

Scott Worley Publisher: New Riders Publishing First Edition November 15, 2001 ISBN: 0-7357-1135-6, 730 pages Inside ASP.NET Here’s what reviewers are saying about Inside ASP.NET: About the Author Contributing Authors About the Technical Reviewers Acknowledgments Tell Us What You Think! Introduction Who Is This Book For? Contents of the Book I: Introducing ASP.NET 1. An Overview of ASP.NET ASP.NET The .NET Base Class Libraries ASP.NET Web Application Configuration Session and State Management Cache Management ASP.NET Web Application Development Layers Web Forms XML Web Services COM/COM+ Interoperability and Component Services ADO.NET Migration from Classic ASP to ASP.NET Globalization and Localization Enhanced Security 2. Developing Applications with ASP.NET Application Settings Files The Page Syntax Commonly Used Objects and Classes in ASP.NET Tracing ASP.NET Applications ASP.NET Migration Issues Summary 3. Configuring ASP.NET Applications Deploying the web.config Configuration File Using the Configuration Section Analyzing the system.web Configuration Sections Summary II: Core ASP.NET 4. Web Form-Based Development Introduction to Web Forms Web Form Architecture Separating Code from the User Interface Server Controls Validation Controls Summary 5. State Management in ASP.NET What Is State Management? Using ASP.NET Application State Management Summary III: ASP.NET and Data Access 6. Using ADO.NET in ASP.NET Applications Data Access from a Web-Based Perspective ADO and ADO.NET Working with the Main ADO.NET Objects Building Data-Oriented Web Forms Transaction-Enabled ASP.NET Applications Summary 7. Using XML in ASP.NET Applications XML Document Structure How XML Is Used in ASP.NET Other XML Technologies Using XML in Your Application Real-World Examples Summary IV: Advanced Technologies 8. XML Web Service Development in ASP.NET Introduction to XML Web Services Using the SOAP Toolkit with XML Web Services XML Web Service Discovery—Advertising Your Service Using an XML Web Service in ASP.NET Pages Summary 9. Securing ASP.NET Applications Overview of ASP.NET Security Features Applying Security in ASP.NET Applications Inside ASP.NET Security Other Security Considerations Summary 10. Using Component Services with ASP.NET What Are Component Services? Applying Component Services in an ASP.NET Application The business Object Using the business Object Serviced Components Summary 11. Using Messaging Services with ASP.NET Introduction to Messaging Systems Managing MSMQ Message Queues with Windows 2000 Architecture of the .NET Messaging Services Accomplishing Tasks Using MSMQ and .NET Summary 12. Using Directory Services with ASP.NET Introducing Directory Services How Does Active Directory Work? The Benefits of Active Directory Active Directory Technology Summary Summary 13. Localizing and Globalizing ASP.NET Applications What Is Localization? Localizing an ASP.NET Web Application Summary V: Advanced Web Forms 14. Cache Control in ASP.NET ASP.NET Cache Management Page Output Caching Fragment Caching (Partial Page Caching) Request Caching Summary 15. Creating User and Custom Controls for ASP.NET User Controls Introduction to Custom Controls Summary 16. Mobile Device Development with ASP.NET Wireless Application Protocol (WAP) Wireless Markup Language (WML) Enter ASP.NET Summary VI: Putting It All Together 17. Putting It All Together What Is ProjectPal? Installing the ProjectPal Application A Brief Application Walkthrough Application Architecture ProjectPal Service Layers ProjectPal Client Interfaces The ProjectPal Database The ProjectPal Components Inside the ProjectPal Code Summary VII: Appendixes A. An Overview of .NET Multiple Development Platforms Multiple Development Languages .NET Base Class Libraries Common Language Runtime (CLR) Common Type System (CTS) .NET Server Products B. ASP.NET Common Object Reference HttpContext Object (Context Intrinsic Control) The HttpApplication Class The HttpApplicationState Class (Application Intrinsic Object) The HttpSessionState Class ( Session Intrinsic Object) The HttpRequest Class (Request Intrinsic Object) The HttpResponse Class (Response Intrinsic Object) The Server Class ( HttpServerUtility ) SMTPMail API C. ADO Common Object Reference DataSet Object DataTable Object DataColumn Object DataRow Class DataRelation Object DataView Object DataRowView Class OLEDBDATA Objects SQLData … Objects D. HTML Server Control Reference HtmlForm Object— < form> Element HtmlInputText Object— < input> Element HtmlInputHidden Object— < input type=“hidden”> Element HtmlInputCheckbox Object— < input type=”checkbox”> Element HtmlInputRadioButton Object— < input type=“radiobutton”> Element HtmlInputFile Object— < input type=“file”> Element HtmlTextArea Object— < textarea> Element HtmlButton Object— < button> Element HtmlInputButton Object— < input type=“button”> Element HtmlAnchor Object— < a> Element HtmlImage Object— < img> Element HtmlInputImage Object— < input type=“image”> Element HtmlSelect Object— < select> and

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧