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

推荐订阅源

博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
爱范儿
爱范儿
月光博客
月光博客
The GitHub Blog
The GitHub Blog
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
T
Tailwind CSS Blog
美团技术团队
D
Docker
V
Visual Studio Blog
Martin Fowler
Martin Fowler
博客园 - 聂微东
The Cloudflare Blog

博客园 - Konimeter

未能为 SSL/TLS 安全通道建立信任的解决办法 sql server中case的简单示例 vb.net读写文本文件简单示例 vb.net获取web验证码在winform中显示的简单示例 c#带cookie访问网页简单示例 vb.net获取网页的简单示例 vb.net多线程简单示例 app.config中的connectionstring ms sql server 2005 select guid返回null的问题 FBL待完成工作 mssql转Oracle某些注意事项 Oracle关于时间/日期的操作 - Konimeter - 博客园 SQLServer和Oracle的常用函数对比 Oracle游标 Oracle中临时表 在Oracle中实现定时操作 Log Xeen的Source Safe 备份 xeen架构下的site和application的区别
vb.net调用存储过程简单示例
Konimeter · 2011-09-18 · via 博客园 - Konimeter

    Private Function validateClient(ByVal guid As StringAs Integer
        
Dim result As Integer = 0
        
Try
            
'读client
            Dim client As SqlDataReader
            
Dim connStr As String = ConfigurationManager.ConnectionStrings("wz").ConnectionString
            
Dim conn As New SqlConnection(connStr)
            
Dim cmd As New SqlCommand("redlim_client_getdetailbyguid", conn)
            cmd.CommandType 
= CommandType.StoredProcedure
            
With cmd.Parameters
                .Add(
New SqlClient.SqlParameter("@clientguid", guid))
            
End With
            conn.Open()
            client 
= cmd.ExecuteReader
            
If Not client Is Nothing AndAlso client.HasRows Then
                client.Read()
                result 
= Integer.Parse(client("redlimClientState")) '获取client的状态
                client.Close()
            
Else
                
'无client,新建client
                client.Close()
                cmd 
= New SqlCommand("redlim_client_create", conn)
                cmd.CommandType 
= CommandType.StoredProcedure
                
With cmd.Parameters
                    .Add(
New SqlClient.SqlParameter("@clientguid", guid))
                
End With
                cmd.ExecuteNonQuery()
End If
        
Catch ex As ExceptionEnd Try
        
Return result
    
End Function