۲۵-خرداد-۱۳۸۶, ۲۳:۴۷:۲۴
۲۷-خرداد-۱۳۸۶, ۰۹:۱۷:۳۳
ذخیره عکس در بانک اطلاعاتی
Dim fs As New FileStream("C:\myImage.bmp", FileMode.OpenOrCreate, FileAccess.Read)
Dim MyData(fs.Length) As Byte
fs.Read(MyData, 0, CInt(fs.Length))
fs.Close()
SqlCommand.Parameters.Item("@Picture").Value = MyDataخواندن عکس از بانک اطلاعاتی
Sub ReadImage(ByVal B() As Byte)
If (B.Length > 0) Then
Dim stream As New MemoryStream(B, True)
stream.Write(B, 0, B.Length)
PB.Image = (New Bitmap(stream))
stream.Close()
End If
End Sub
موفق باشید
Dim fs As New FileStream("C:\myImage.bmp", FileMode.OpenOrCreate, FileAccess.Read)
Dim MyData(fs.Length) As Byte
fs.Read(MyData, 0, CInt(fs.Length))
fs.Close()
SqlCommand.Parameters.Item("@Picture").Value = MyDataخواندن عکس از بانک اطلاعاتی
Sub ReadImage(ByVal B() As Byte)
If (B.Length > 0) Then
Dim stream As New MemoryStream(B, True)
stream.Write(B, 0, B.Length)
PB.Image = (New Bitmap(stream))
stream.Close()
End If
End Sub
موفق باشید
۲۷-خرداد-۱۳۸۶, ۰۹:۲۳:۲۴
VB.NET 2005
-----------------------------------------------
Function WriteImage() as Byte()
Dim fs As New FileStream("C:\MyPicture.bmp", FileMode.OpenOrCreate, FileAccess.Read)
Dim MyData(fs.Length) As Byte
fs.Read(MyData, 0, CInt(fs.Length))
fs.Close()
Return MyDate()
End Function
------------------------------------------------
Sub ReadImage(ByVal B() As Byte)
If (B.Length > 0) Then
Dim stream As New MemoryStream(B, True)
stream.Write(B, 0, B.Length)
PB.Image = (New Bitmap(stream))
stream.Close()
End If
End Sub
------------------------------------------------
-----------------------------------------------
Function WriteImage() as Byte()
Dim fs As New FileStream("C:\MyPicture.bmp", FileMode.OpenOrCreate, FileAccess.Read)
Dim MyData(fs.Length) As Byte
fs.Read(MyData, 0, CInt(fs.Length))
fs.Close()
Return MyDate()
End Function
------------------------------------------------
Sub ReadImage(ByVal B() As Byte)
If (B.Length > 0) Then
Dim stream As New MemoryStream(B, True)
stream.Write(B, 0, B.Length)
PB.Image = (New Bitmap(stream))
stream.Close()
End If
End Sub
------------------------------------------------