CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Location
    Pakistan
    Posts
    41

    Question piture, image or jpg file save in sql server

    hello friends
    any body will tell me how i save picture, image or jpg file into the sql server through vb6 code.....
    please help me in this condition
    i will be thankful to u.
    thanks in advance.

  2. #2
    Join Date
    Dec 2001
    Posts
    6,332

    Re: piture, image or jpg file save in sql server

    There have been a number of threads discussing this question, which I'm sure will turn up from a search.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  3. #3
    Join Date
    Apr 2008
    Location
    Pakistan
    Posts
    41

    Question Re: piture, image or jpg file save in sql server

    dear WizBang

    i had searched but i cant found any thing
    so please help me .

  4. #4
    Join Date
    Dec 2006
    Location
    Pune, India.
    Posts
    579

    Re: piture, image or jpg file save in sql server

    Keep the datatype as image in SQL server

    This is the code to save the file to server :

    Code:
        Dim strm As New ADODB.Stream
            
        strm.Type = adTypeBinary
        strm.Open
        strm.LoadFromFile "C:\Photo.jpg"
        
        rs!EmpImage = strm.Read

    Thats it!




    Riyaz

  5. #5
    Join Date
    Dec 2001
    Posts
    6,332

    Re: piture, image or jpg file save in sql server

    In addition to the example posted by Shaikh.Riyaz.a, the VB FAQ has a link to a thread which you might find very helpful:
    http://www.codeguru.com/forum/showthread.php?t=220033
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured