Foxtable(狐表)用户栏目专家坐堂 → PositionChanged事件里这样写代码有问题吗?


  共有2459人关注过本帖树形打印复制链接

主题:PositionChanged事件里这样写代码有问题吗?

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107680 积分:547721 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/3/23 11:23:00 [显示全部帖子]

二进制图片?

        Dim cmd As new SQLCommand
        cmd.ConnectionName = "xxx"
        cmd.CommandText="s elect 示意图 from ZL_SKU where SKU编码='" & cur("产品编号") & "'"
        Dim dt As DataTable = cmd.ExecuteReader
        Dim src As String
        If dt.DataRows.Count >0 Then
            Dim imagebytes As Byte() = dt.DataRows(0)("示意图")
Dim stream As System.IO.Stream = New System.IO.MemoryStream(imagebytes)
Dim bmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(stream)
e.Form.Controls("PictureBox1").Image = bmp
        End If

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107680 积分:547721 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/3/23 14:21:00 [显示全部帖子]

If e.Table.Cols.Contains("产品编号") Then
    Dim cmd As New SQLCommand
    cmd.C
    cmd.CommandText = "s elect 示意图 from ZL_SKU where SKU编码='" & cur("产品编号") & "'"
dim str as string = cmd.ExecuteScalar 
    If str > "" Then
        e.Form.Controls("PictureBox1").Image = Functions.Execute("Base64ToImage",str)
    Else
        e.Form.Controls("PictureBox1").Image = Nothing
    End If
End If

 回到顶部