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

推荐订阅源

Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
N
News and Events Feed by Topic
T
Troy Hunt's Blog
PCI Perspectives
PCI Perspectives
W
WeLiveSecurity
N
News | PayPal Newsroom
Recent Commits to openclaw:main
Recent Commits to openclaw:main
V2EX - 技术
V2EX - 技术
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threat Research - Cisco Blogs
L
LINUX DO - 热门话题
Cloudbric
Cloudbric
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
Y
Y Combinator Blog
L
LangChain Blog
Recorded Future
Recorded Future
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
Attack and Defense Labs
Attack and Defense Labs
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
小众软件
小众软件
H
Hacker News: Front Page
The Hacker News
The Hacker News
T
Tailwind CSS Blog
The Register - Security
The Register - Security
Hacker News: Ask HN
Hacker News: Ask HN
P
Privacy & Cybersecurity Law Blog
P
Palo Alto Networks Blog
S
Securelist
腾讯CDC
雷峰网
雷峰网
G
Google Developers Blog
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
Arctic Wolf
www.infosecurity-magazine.com
www.infosecurity-magazine.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
阮一峰的网络日志
阮一峰的网络日志
AI
AI

博客园 - 生活即技术

好久不更新了,忙的惭愧哦,思考一个应用 利用dataTable 排序的解决方法 项目中遇到的一些小问题及解决方法 常用代码 一个com+消息队列的例子 部署Com+ 2004我的爱,2005我的期待 加密解密相关 生成略缩图 论坛在线人数统计代码 正则表达式(1) 又一新的分页方法(转帖) 用户控件的使用(二) 用户控件的使用(一) DataList的使用(二)自定义分页的实现 DataList的使用(1) DataGrid的使用(2)自定义分页 DataGrid的使用(1)
上礼拜六犯的愚蠢错误
生活即技术 · 2004-11-29 · via 博客园 - 生活即技术

 上礼拜六 写了这样一段事务处理的代码。           
            on error resume next 
               Dim Myconn As New SqlClient.SqlConnection
                Dim Mycmd As New SqlClient.SqlCommand
                Dim str As String = System.Configuration.ConfigurationSettings.AppSettings("Connstr")
                Myconn.ConnectionString = str
                Myconn.Open()
                Dim trans As SqlClient.SqlTransaction = Myconn.BeginTransaction         
               Mycmd.Connection = Myconn
                Mycmd.Transaction = trans
    执行内容略 
                Mycmd.ExecuteNonQuery()
                if err.number<>0 then                         ' 检测是否有错误
                   trans.commit()
                   myconn.close
                  else 
                    trans.rollback()
                     myconn.close
                     response.write(err.description)
                  end if
   结果出现了错误。 
   错误描述是:事务对象未初始化等等
   是什么原因呢?事务对象未初始化。考虑的方向应该是定义事务对象这方面。可惜当天没有解决。回家后也是在想这个问题。
   到了今天在明白。
   Dim trans As SqlClient.SqlTransaction = Myconn.BeginTransaction         
   Myconn.Beging.Transaction 应该有参数,真是苯呀。
   最后根据自己的需要用了 
  Dim trans As SqlClient.SqlTransaction = Myconn.BeginTransaction(IsolationLevel.RepeatableRead)
  问题解决。