Click here to Skip to main content
15,892,746 members
Home / Discussions / Database
   

Database

 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Mark J. Miller17-Mar-08 6:56
Mark J. Miller17-Mar-08 6:56 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Rocky#17-Mar-08 7:11
Rocky#17-Mar-08 7:11 
Questionavoiding 1/1/1900 in SQL SERVER? Pin
John Sundar14-Mar-08 23:03
John Sundar14-Mar-08 23:03 
GeneralRe: avoiding 1/1/1900 in SQL SERVER? Pin
Rocky#15-Mar-08 1:06
Rocky#15-Mar-08 1:06 
GeneralRe: avoiding 1/1/1900 in SQL SERVER? Pin
Mark J. Miller17-Mar-08 4:54
Mark J. Miller17-Mar-08 4:54 
GeneralBest Practice: Connection Strings to MS-SQL datasource from web application Pin
Leo Smith14-Mar-08 9:18
Leo Smith14-Mar-08 9:18 
GeneralRe: Best Practice: Connection Strings to MS-SQL datasource from web application Pin
Mark J. Miller17-Mar-08 5:07
Mark J. Miller17-Mar-08 5:07 
GeneralStoring Compressed Image Into SQL Server Pin
abdurrahman oğuz14-Mar-08 6:30
abdurrahman oğuz14-Mar-08 6:30 
i use BmpToArray function to store compressed image into sql server 2005 (column's type is image). when i tried to decompress it by using ArrayToBmp function, i received an array which is filled by 0's. so the result is wrong...



is there anything wrong?
Public Function BmpToArray(ByVal bmp As Bitmap) As Byte()
    If Not bmp Is Nothing Then
        Dim srcStream As New MemoryStream()
        Dim destStream As New MemoryStream()

        Try
            bmp.Save(srcStream, System.Drawing.Imaging.ImageFormat.Bmp)

            Dim buffer(CType(srcStream.Length - 1, Integer)) As Byte
            Dim gZip As New GZipStream(destStream, CompressionMode.Compress)

            gZip.Write(buffer, 0, buffer.Length)
            gZip.Flush()
            gZip.Close()
            gZip = Nothing

            Return destStream.ToArray()
        Finally
            srcStream.Close()
        End Try
    End If

    Return Nothing
End Function

Public Function ArrayToBmp(ByVal arr() As Byte) As Bitmap
    If (arr.Length > 0) Then
        Dim srcStream As New MemoryStream(arr)
        Dim destStream As New MemoryStream()

        Try
            Dim buffer(1024) As Byte
            Dim gZip As New GZipStream(srcStream, CompressionMode.Decompress)
            Dim readingByte As Integer = gZip.Read(buffer, 0, 1024)

            Do While readingByte > 0
                destStream.Write(buffer, 0, readingByte)
                readingByte = gZip.Read(buffer, 0, 1024)
            Loop

            gZip.Flush()
            gZip.Close()
            gZip = Nothing

            Return New Bitmap(destStream)
        Finally
            destStream.Close()
            srcStream.Close()
        End Try
    End If

    Return Nothing
End Function


thanks...


GeneralRe: Storing Compressed Image Into SQL Server Pin
Rob Philpott14-Mar-08 6:38
Rob Philpott14-Mar-08 6:38 
GeneralRe: Storing Compressed Image Into SQL Server [modified] Pin
abdurrahman oğuz14-Mar-08 22:40
abdurrahman oğuz14-Mar-08 22:40 
GeneralRe: Storing Compressed Image Into SQL Server Pin
Mark Churchill16-Mar-08 1:57
Mark Churchill16-Mar-08 1:57 
Generalinsert user checkboxlist selections in table Pin
C. L. Phillip14-Mar-08 4:26
C. L. Phillip14-Mar-08 4:26 
GeneralRe: insert user checkboxlist selections in table Pin
Mark J. Miller14-Mar-08 6:28
Mark J. Miller14-Mar-08 6:28 
GeneralRe: insert user checkboxlist selections in table Pin
C. L. Phillip14-Mar-08 9:36
C. L. Phillip14-Mar-08 9:36 
GeneralPlease help me move these records to another table... Pin
Support12314-Mar-08 3:10
Support12314-Mar-08 3:10 
GeneralRe: Please help me move these records to another table... Pin
soni uma14-Mar-08 3:20
soni uma14-Mar-08 3:20 
GeneralRe: Please help me move these records to another table... Pin
Support12314-Mar-08 3:23
Support12314-Mar-08 3:23 
GeneralRe: Please help me move these records to another table... Pin
soni uma14-Mar-08 3:26
soni uma14-Mar-08 3:26 
GeneralRe: Please help me move these records to another table... Pin
Support12314-Mar-08 3:25
Support12314-Mar-08 3:25 
GeneralFetching records based on Boolean operators Pin
sumit703414-Mar-08 0:41
sumit703414-Mar-08 0:41 
GeneralRe: Fetching records based on Boolean operators Pin
GDMFSOB14-Mar-08 0:48
GDMFSOB14-Mar-08 0:48 
GeneralRe: Fetching records based on Boolean operators Pin
sumit703414-Mar-08 0:55
sumit703414-Mar-08 0:55 
GeneralRe: Fetching records based on Boolean operators Pin
GDMFSOB14-Mar-08 1:07
GDMFSOB14-Mar-08 1:07 
QuestionTable change Watch In SQL 2000 Pin
GDMFSOB14-Mar-08 0:39
GDMFSOB14-Mar-08 0:39 
GeneralRe: Table change Watch In SQL 2000 Pin
sumit703414-Mar-08 1:01
sumit703414-Mar-08 1:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.