VB.NET执行存储过程

前端之家收集整理的这篇文章主要介绍了VB.NET执行存储过程前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

'----------------------------------------------------------------
'
'
' 功能:计算单签字
' 参数:计算单标识码,审核状态
' 返回:成功与否
'
'----------------------------------------------------------------
<AutoComplete()> _
Public Function Signature(ByVal CalSheetID As System.Guid,ByVal Power As System.Int16) As Boolean
Dim ssql As String
Dim sysInfo As New CSBusinessRules.SystemInfo()
Dim Params() As sqlParameter = _
{New sqlParameter("@标识码",sqlDbType.UniqueIdentifier),_
New sqlParameter("@审核状态",sqlDbType.SmallInt)}
Params(0).Value = CalSheetID
Params(1).Value = Power

ssql = "UPDATE Measure_CalculationSheet "
ssql = ssql & "SET 审核状态 =@审核状态 "
ssql = ssql & "WHERE (标识码 = @标识码) "

' 运行语句
Try
Return m_objDataLayer.Executesql(ssql,Params)
Catch ex As Exception
Throw New Exception(ex.Message,ex)
Return False
End Try
End Function

--------------------------------------------------------------------------

1、在远程机建立共享文件夹,并分配相应的写权限

2、在要进行备份的数据库实例中运行以下命令,以建立信任关系:
master..xp_cmdshell 'net use//remoteserver_name/sharefolder password /user:domain/user'

2005要配置允许执行xp_cmdshell

3、backup database database_name to disk='//remoteserver_name/sharefolder/master.bak'

原文链接:https://www.f2er.com/vb/264228.html

猜你在找的VB相关文章