惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
量子位
T
Tailwind CSS Blog
T
Threatpost
The GitHub Blog
The GitHub Blog
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
P
Proofpoint News Feed
博客园 - 司徒正美
L
LangChain Blog
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
T
Troy Hunt's Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
I
Intezer
P
Privacy & Cybersecurity Law Blog
美团技术团队
N
Netflix TechBlog - Medium
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
Google Developers Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tenable Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI

博客园 - 谢T

转载:老问题再次发生 “从客户端(userName="<hr />")中检测到有潜在危险的 Request.Form 值” 解决方案 数据绑定 DataTable - 谢T - 博客园 清除SQL注入的语句 分页存储过程3 生活规则 分页存储过程-02 (CodeMatic) 分页存储过程-01(转) html 导出 word (转) - 谢T ado.net 数据阅读器 - 谢T - 博客园 双截棍(程序员版) 交流学习 yo2 Blog(WordPress) 申请码大放送 初识 ado.net 页面传值 ASP.NET 2.0技术内幕 20080606 第一部分 .net与面向对象 第一章 OO大智慧 开始
ado.net 续1
谢T · 2008-11-24 · via 博客园 - 谢T

1。连接池

注意关闭连接对象

eg:

数据库连接

 SqlConection 平时使用的不是很多,常见的就是上面的问题。

2.执行命令

执行一次

SqlComand :

 属性(略);

方法:

BeginExecuteNonQuery :以非阻塞方法 执行一个非查询命令 1.x不支持

BeginExecuteReader:以非阻塞方法 执行一个查询命令 1.x不支持

BeginExecuteXmlReader:以非阻塞方法 执行一个xml查询命令 1.x不支持

Cancel:尝试取消Sqlcomand 的执行,失败不会产生异常

CreateParameter:建立Sqlparameter 的新实例

EndExecuteNonQuery:完成一个异步执行的非查询命令 1.x不支持

EndExecuteReader:完成一个异步执行的查询命令 1.x不支持

EndExecuteXmlReader:完成一个异步执行的xml查询命令 1.x不支持

ExecuteNonQuery:执行一个非查询命令,返回受影像的行数

ExecuteReader:执行一个查询命令,并返回一个该数据的只读游标(数据阅读器)

ExecuteScalar:执行一个查询,并返回结果集中 0,0(第一行,第一列)的值

 ExecuteXmlReader:执行的xml查询命令 返回XML数据并创建一个XmlReader对象

Prepare:在sql中的一个实例,创建改命令的一个准备版本。

ResetCommandTimeout:将命令超时重置为默认值。

ExecuteScalar的通常与select count 一起用,也常用于检索总值。

...未完待续

下节预告:SqlDataReader (数据阅读器类)