-
November 16th, 2008, 05:59 AM
#1
databind pictureBox to SQl server database
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|