Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OleDbConnection myConnection = new OleDbConnection("File Name = mylink.udl");
- myConnection.Open();
- OleDbCommand cmd = new OleDbCommand("SELECT Stu_Name,Photo FROM stu_Details WHERE Stu_ID ='" + stuid + "'", myConnection);
- var da = new OleDbDataAdapter(cmd);
- var ds = new DataSet();
- da.Fill(ds, "Photo");
- int count = ds.Tables["Photo"].Rows.Count;
- if (count > 0)
- {
- var data = (Byte[])ds.Tables["Photo"].Rows[count - 1]["Photo"];
- var stream = new MemoryStream(data);
- pictureBox2.Image = Image.FromStream(stream);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement