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

推荐订阅源

有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
aimingoo的专栏
aimingoo的专栏
IT之家
IT之家
G
Google Developers Blog
爱范儿
爱范儿
博客园 - 司徒正美
Recent Announcements
Recent Announcements
The Register - Security
The Register - Security
J
Java Code Geeks
The Cloudflare Blog
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Security Blog
Microsoft Security Blog
博客园 - Franky
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
宝玉的分享
宝玉的分享
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
T
Troy Hunt's Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hacker News: Front Page
H
Help Net Security
S
Security @ Cisco Blogs
V
V2EX
Security Archives - TechRepublic
Security Archives - TechRepublic
Stack Overflow Blog
Stack Overflow Blog
O
OpenAI News
L
LINUX DO - 最新话题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
S
Secure Thoughts
Help Net Security
Help Net Security
F
Full Disclosure
博客园 - 叶小钗
The Hacker News
The Hacker News
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
K
Kaspersky official blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Vulnerabilities – Threatpost
P
Privacy International News Feed
Scott Helme
Scott Helme

博客园 - 生活即技术

好久不更新了,忙的惭愧哦,思考一个应用 利用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)
  问题解决。