bebakhshid
دوشنبه 17 مرداد 1384, 01:34 صبح
سلام
من میخوام یه عکس را در یه picturebox بریزم اما ایرادInvalid parameter used. میگیره
If e.KeyValue = 13 Then
da.SelectCommand = New OleDbCommand("select doc.stdno as شمارهدانشجو,title.title as عنوان, student.stdname as نامخانوادگی ,student.fname as اسم FROM title INNER JOIN (student INNER JOIN doc ON student.stdno = doc.stdno) ON title.radif = doc.radif where doc.stdno=@stdno", OleDbConnection1)
da.SelectCommand.Parameters.Add("@stdno", System.Convert.ToInt32(TextBox1.Text))
ds.Clear()
da.Fill(ds, "student")
DataGrid1.SetDataBinding(ds, "student")
'Load Picture in picturebox
Dim curr As Integer
Dim CurrentRowIndex As Integer
Dim cmd As New OleDbCommand("select doc.aks from doc", OleDbConnection1)
OleDbConnection1.Close()
OleDbConnection1.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader
If Not dr Is Nothing Then
CurrentRowIndex = DataGrid1.CurrentRowIndex
While dr.Read And curr <= CurrentRowIndex
curr += 1
Dim ByteArray As Byte() = CType(dr("aks"), Byte())
Dim ms As New MemoryStream(ByteArray)
PictureBox1.Image = Image.FromStream(ms)
End While
End If
OleDbConnection1.Close()
End If
من میخوام یه عکس را در یه picturebox بریزم اما ایرادInvalid parameter used. میگیره
If e.KeyValue = 13 Then
da.SelectCommand = New OleDbCommand("select doc.stdno as شمارهدانشجو,title.title as عنوان, student.stdname as نامخانوادگی ,student.fname as اسم FROM title INNER JOIN (student INNER JOIN doc ON student.stdno = doc.stdno) ON title.radif = doc.radif where doc.stdno=@stdno", OleDbConnection1)
da.SelectCommand.Parameters.Add("@stdno", System.Convert.ToInt32(TextBox1.Text))
ds.Clear()
da.Fill(ds, "student")
DataGrid1.SetDataBinding(ds, "student")
'Load Picture in picturebox
Dim curr As Integer
Dim CurrentRowIndex As Integer
Dim cmd As New OleDbCommand("select doc.aks from doc", OleDbConnection1)
OleDbConnection1.Close()
OleDbConnection1.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader
If Not dr Is Nothing Then
CurrentRowIndex = DataGrid1.CurrentRowIndex
While dr.Read And curr <= CurrentRowIndex
curr += 1
Dim ByteArray As Byte() = CType(dr("aks"), Byte())
Dim ms As New MemoryStream(ByteArray)
PictureBox1.Image = Image.FromStream(ms)
End While
End If
OleDbConnection1.Close()
End If