抱歉Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "s elect top 1 style_id,image_1 from s_style where style_id like '%19s%' and image_1 is not null"
Dim dt As DataTable = cmd.ExecuteReader
Dim src As String
If dt.DataRows.Count > 0 Then
For Each dr As DataRow In dt.DataRows
If dr.Isnull("image_1") = False Then
src = "c:\desk\aa\" + dr("style_id") + ".jpg"
Dim img As Image
img = dr.SQLLoadImage("image_1")
MessageBox.Show(src) ‘这个显示前提示错误【未将对象引用设置到对象的实例。】
' img.Save(src)
' Dim imagebytes As Byte() = dr("image_1")
' Using stream As System.IO.Stream = New System.IO.MemoryStream(imagebytes)
' Dim bmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(stream)
' bmp.save(src)
' bmp.Dispose
' stream.Close
' stream.Dispose
' End Using
End If
Next
End If