测试的小段代码vb.net-sql存储过程

前端之家收集整理的这篇文章主要介绍了测试的小段代码vb.net-sql存储过程前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

测试的小段代码vb.net-sql存储过程

VB.Net代码测试 byte 如何使用。

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click
Dim bt() As Byte
If bt Is Nothing Then
MsgBox("bt is nothing")
End If
ReDim bt(1)
bt(0) = CByte(0)
bt(1) = CByte(22)
If bt IsNot Nothing Then
MsgBox("bt isnot nothing")
MsgBox(bt(0).ToString & "0--22" & bt(1).ToString)
End If
End Sub

存储过程,用来更新sql server数据库 图片字段的内容

CREATE PROCEDURE ItemImgBinarySUpdate
@ItemNo nvarchar(50),
@ImgBinary image=null,
@ImgBinary2nd image=null
AS
declare @RowC int
if @ImgBinary is not null
Begin
Update [ItemImgTB] Set ImgBinary=@ImgBinary Where ItemNo=@ItemNo
set @RowC=@@RowCount
End
if @ImgBinary2nd is not null
Begin
Update [ItemImgTB] Set ImgBinary2nd=@ImgBinary2nd Where ItemNo=@ItemNo
set @RowC=@RowC+@@RowCount
End
Select @RowC
GO


存储过程,用来删除sql server数据库 图片字段的内容
CREATE PROCEDURE ItemImgBinarySDelete
@ItemNo nvarchar(50),
@ImgDeleteFlag smallint
--1删除第一 2删除第二个 3两个都删除
As
If @ImgDeleteFlag=1
Update [ItemImgTB] Set ImgBinary=null Where ItemNo=@ItemNo
Else If @ImgDeleteFlag=2
Update [ItemImgTB] Set ImgBinary2nd=null Where ItemNo=@ItemNo
Else If @ImgDeleteFlag=3
Update [ItemImgTB] Set ImgBinary=null,ImgBinary2nd=null Where ItemNo=@ItemNoSelect @@RowCountGO

猜你在找的VB相关文章