Community discussion forum

How to Databind PictureBox to database

  • 1 year ago
    I have a winform with one pictureBOx and one datanavigator control. I want to bind them to Northwind Employees table(Photo column) with the following code. I can see the images and can navigate through them also thru the datanavigator. But the images are not clear(hazy). can anybody help me out? --------------------------------------------------------------------- string connString = @"Data Source=local\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True"; string data = "Select * from Employees"; SqlConnection conn = new SqlConnection(connString); SqlDataAdapter da = new SqlDataAdapter(data, conn); DataSet ds = new DataSet(); da.Fill(ds, "Employees"); this.pictureBox1.DataBindings.Add("Image", ds, "Employees. Photo"); ------------------------------------------------------------ Can anybody give me the correct code? Thanks
    Post was edited on 16/11/2008 10:58:00 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!