473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

databind pictureBox control to SQL server Northwind

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

Nov 16 '08 #1
0 1425

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marty McDonald | last post by:
I have <asp:Table... </asp:Table> on my webform. In codebehind, I populate a DataTable whose data should appear in the asp:Table. I created my own code to populate the asp:Table with the...
10
by: aualias | last post by:
This seems like such a lame question, but how do you bind to a CheckBox with ASP.NET? With Windows Forms there is a DataBindings collection. I do not see it with the web version of the control,...
5
by: Joel Reinford | last post by:
I am attempting to verify whether a datareader is closed by calling the databind on a control. for example (fake code) Dim rdr as SqlDataReader rdr = mycommand.executeReader... ...
17
by: Jan Nielsen | last post by:
Hi I would like to databind a Picturebox to a SQL Server. I have a typed Dataset "DSBoernekirken1" It has a table named "tpersoner" with a column "Photo" I of course would like to bind the...
5
by: BrianW | last post by:
I am working on a program that has multiple picturebox controls that a user is allowed to move around which are contained within a panel control for visual placement. In my mousedown event, I set...
7
by: Gary Shell | last post by:
I have a column named "PictureImage" in a SQL database defined as datatype=image. It has a Bitmap picture in it. (I verified the type by creating an Access project and a looking at the data,...
14
by: GSSI | last post by:
I have an image data field in a datarow (as in the Northwinds demo sql database). What is the C# instruction syntax to display it in a Winform picturebox control. -- GSSI
3
by: kirk | last post by:
I have a form with a PictureBox control on it. The .Image property is set to a PNG file(which shows the picture of the US map) with some transparency in it. The .BackColor property is set to...
1
by: leshka82 | last post by:
I have recently designed a Winform Image drag & drop utility. The approach I took was to have a Panel control serve as a destination for multiple file drop. Once the user dragged & dropped the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.