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

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
J
Java Code Geeks
G
Google Developers Blog
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
月光博客
月光博客
B
Blog
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
博客园_首页
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News

博客园 - 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