title: Parameter Not valid” Error in VB.NET While retrive image to picturebox from sql database
body: <pre><code>Dim con As New SqlConnection
  Dim cmd As New SqlCommand
  Dim str As String
  Dim dr As SqlDataReader
  
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  
      str = "select * from llr where llrno='" &amp; TextBox1.Text &amp; "'"
      cmd = New SqlCommand(str, con)
      con.Open()
      dr = cmd.ExecuteReader()
      If dr.HasRows Then
          dr.Read()
          Dim img As Byte() = DirectCast(dr("img"), Byte())
          Dim ms As New MemoryStream(img)
          PictureBox1.Image = Image.FromStream(ms)
      End If
      dr.Close()
      cmd.Dispose()
      con.Close()
  End Sub
  </code></pre>