以下代码引发类型为“System.OutOfMemoryException”的异常。
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "s elect style_id,image_1 from s_style"
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
Dim stream As System.IO.Stream
Dim bmp As System.Drawing.Bitmap
Dim imagebytes As Byte() = dr("image_1")
Stream = New System.IO.MemoryStream(imagebytes)
bmp = New System.Drawing.Bitmap(stream)
bmp.save("c:\desk\image_1\" + dr("style_id") + ".jpg")
End If
Next
End If