hi guys.just want a help in this codes. i use radiobutton for my search. i use to choose radiobutton Sidnum(school id number) to search a student. the problem with this is the picture from my DB doesnt view. the error said FileNotFindException was unhandled and pointing to this code PictureBox1.Image = Image.FromFile("C:\Users\YouStyle\Desktop\New System ADMIN Only\ADMINSystemofHolyRedeemer\CampusPictureData\" & frmLogin.userpics & ""). guys help please.. :( i think the problem with this is this code & frmLogin.userpics & . i dont know what code will i use to retrieve the picture form my DB
If RBBSiDnum.Checked Then
IDA = New OleDbDataAdapter
IDA.SelectCommand = New OleDbCommand("Select * from tblStudentData where tblStudentData.SchooliDNum='" & txtSearch.Text & "'", cn)
IDS.Clear()
IDA.Fill(IDS)
If IDS.Tables(0).Rows.Count > 0 Then
dt = New DataTable("Temp")
cmd = New OleDbCommand("Select * from tblStudentData where tblStudentData.SchooliDNum='" & txtSearch.Text & "'", cn)
cn.Open()
dr = cmd.ExecuteReader()
dt.Clear()
For Me.i = 0 To dr.FieldCount - 1
dt.Columns.Add(dr.GetName(i), dr.GetFieldType(i))
Next
While dr.Read
Dim drw As DataRow = dt.NewRow
For Me.i = 0 To dr.FieldCount - 1
drw(i) = dr(i)
Next
dt.Rows.Add(drw)
End While
dr.Close()
cn.Close()
Remove_Binding()
Add_Binding()
PictureBox1.Image = Image.FromFile("C:\Users\YouStyle\Desktop\New System ADMIN Only\ADMINSystemofHolyRedeemer\CampusPictureData\" & frmLogin.userpics & "")
If RBBSiDnum.Checked Then
IDA = New OleDbDataAdapter
IDA.SelectCommand = New OleDbCommand("Select * from tblStudentData where tblStudentData.SchooliDNum='" & txtSearch.Text & "'", cn)
IDS.Clear()
IDA.Fill(IDS)
If IDS.Tables(0).Rows.Count > 0 Then
dt = New DataTable("Temp")
cmd = New OleDbCommand("Select * from tblStudentData where tblStudentData.SchooliDNum='" & txtSearch.Text & "'", cn)
cn.Open()
dr = cmd.ExecuteReader()
dt.Clear()
For Me.i = 0 To dr.FieldCount - 1
dt.Columns.Add(dr.GetName(i), dr.GetFieldType(i))
Next
While dr.Read
Dim drw As DataRow = dt.NewRow
For Me.i = 0 To dr.FieldCount - 1
drw(i) = dr(i)
Next
dt.Rows.Add(drw)
End While
dr.Close()
cn.Close()
Remove_Binding()
Add_Binding()
PictureBox1.Image = Image.FromFile("C:\Users\YouStyle\Desktop\New System ADMIN Only\ADMINSystemofHolyRedeemer\CampusPictureData\" & frmLogin.userpics & "")