网站大量收购独家精品文档,联系QQ:2885784924

zy01-2011 ADO.NET-概览.pptx

  1. 1、本文档共56页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
zy01-2011 ADO.NET-概览.pptx

詹英-2011;ADO.NET课程简介;ADO.NET 是一系列与数据操作相关的类。它们提供 比 ADO 更灵活的数据访问机制 为非连接环境设计的系统架构 支持 XML 的编程对象模型 一系列用来在 .NET 架构中访问数据的类、结构以及枚举器;ADO.NET 简介(续);ADO.NET 支持下列的存储类型 无结构 有结构, 无层次的数据 以逗号分离的数据 (CSV) 文件、 Microsoft Excel 电子表格、Microsoft Exchange 文件、Active Directory 文件等 有层次的数据 XML 文档等 关系型数据库 SQL Server、Oracle、Access 等;数据存储;连接环境 ;演示;非连接环境;非连接环境(续);using System; using System.Data.SqlClient; //简单的链接数据库 namespace TK70561 { class Program { static void Main(string[] args) { // configure and open the database connection here SqlConnection theConnection = new SqlConnection(); theConnection.ConnectionString = Data Source=jim-pc;Initial Catalog=VideoGameStoreDB;Integrated Security=SSPI;; theConnection.Open(); if (theConnection.State == System.Data.ConnectionState.Open) Console.WriteLine(Database Connection is Open); } } };;层的概念 客户层 也被称为表现层,主要是用户界面 业务层(中间层) 包含业务逻辑的封装以及与数据源交互 数据层 应用中涉及到的数据服务 交互层 提供不同应用,不同平台的集成(如 Web 服务);数据访问应用模型 (续);与数据相关的命名空间 ;4个.NET数据提供;(续表);;在非连接环境中使用ADO.NET;ADO.NET 与 XML;; string snn = Data Source=.;Initial Catalog=student;Integrated Security=True; SqlConnection testConnection = new SqlConnection(snn); SqlCommand testCommand = testConnection.CreateCommand(); testCommand.CommandText = Select name from stuinfo; testConnection.Open(); string result = (string)testCommand.ExecuteScalar(); testConnection.Close(); Console.WriteLine(result); };连接字符串;using System.Configuration; using System.Web.Configuration; //字符串加密 Configuration theConfiguration = WebConfigurationManager.OpenWebConfiguration(~); ConfigurationSection connectionStringConfigSection = theConfiguration.GetSection(connectionStrings); if (connectionStringConfigSection != null !connectionStringConfigSection.IsReadOnly() !co

文档评论(0)

专业好文档 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6110200002000000

1亿VIP精品文档

相关文档