Results 1 to 3 of 3

Thread: Read and write images in vb.net from a database using SQL Server

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Answers
    1

    Read and write images in vb.net from a database using SQL Server

    Read and write images in vb.net from a database using SQL Server


  2. #2
    Junior Member
    Join Date
    Jan 2009
    Answers
    1

    Re: Read and write images in vb.net from a database using SQL Server

    ghfghghfghfhdfg


  3. #3
    Junior Member
    Join Date
    Jul 2006
    Answers
    22

    Re: Read and write images in vb.net from a database using SQL Server

    To Save image in the database u can try out this.

    fs = New FileStream(TextBox1.Text, FileMode.Open)
    br = New BinaryReader(fs)
    Dim imageByte() As Byte = br.ReadBytes(fs.Length)
    com = New SqlCommand("insert into EmpPhotos(eCode,empPhoto)values(@eCode,@empPhoto)", con)
    Dim pa1 As SqlParameter = New SqlParameter("@eCode", SqlDbType.Int)
    pa1.Value = Convert.ToInt32(TextBox2.Text)
    Dim pa2 As SqlParameter = New SqlParameter("@empPhoto", SqlDbType.Image)
    pa2.Value = imageByte
    com.Parameters.Add(pa1)
    com.Parameters.Add(pa2)
    con.Open()
    com.ExecuteNonQuery()
    con.Close()


  4.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact