Urgent :-how to store image from ASP.NET to sql server 2000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abraham1
    New Member
    • Feb 2008
    • 2

    Urgent :-how to store image from ASP.NET to sql server 2000

    Hai,
    As I am doing project in a university , i need the coding of how to store image in sql server 2000 from asp.net written in vb language.
    Can anyone of U please help me.......
    I need this help immediately...
    I Could not suceed after i have searched a lot............ ..
  • kunal pawar
    Contributor
    • Oct 2007
    • 297

    #2
    create image field in Sql server table
    and convert your image file into byte and store it in sql table

    Dim imgStream As Stream = fileUploadForSi lideImage.Poste dFile.InputStre am
    Dim imgLen As Integer = fileUploadForSi lideImage.Poste dFile.ContentLe ngth
    Dim imgBinaryData(i mgLen) As Byte
    im n As Integer = imgStream.Read( imgBinaryData, 0, imgLen)
    Now
    u can store imgBinaryData into database

    Or
    see the link
    http://aspalliance.com/articleViewer.a spx?aId=138&pId =

    Comment

    • vinci
      New Member
      • Aug 2006
      • 62

      #3
      Use System.IO.FileS tream to convert it to binary.. then save that binary value to the database...


      Read about FileStream my friend...

      Comment

      • abraham1
        New Member
        • Feb 2008
        • 2

        #4
        Thank you vinci,kunal pawar for immediate Response.....

        Actually in the aspalliance website it is somewhat complicated..

        i have image

        C:\abraham.jpg

        i have table imagestore

        id integer
        image blog

        Actually in ur code i could not see any image location....... .

        Is there any easiest way to store my image from ASP.NET to sql server 2000.
        Please give me full code....i will try....

        Comment

        Working...