SQL Database pictures in datagridview
-
Hello I am new to this forum... I have a quick question... well I've created a Address Book, basically as my first program that I want to show my family.. On the first form it is all textboxes, datatimepicker, and a picturebox. You click the menu to open the DataGrid form I created.. in this I have a DataGridView. I have two problems. The DataGridView is always missing the first row of data. ID is the primary key and auto increments. It is always missing the first one... Also how do I get the table to display the image they chose with the person they added? I have the column as a image column but it will not display. The Picturebox is in the database. Here is how they load the picture: try { DialogResult result = new DialogResult(); OpenFileDialog openfile = new OpenFileDialog(); result = openfile.ShowDialog(); if (result == DialogResult.Cancel) { return; } else { picturePictureBox.Image = Image.FromFile(openfile.FileName); } } catch (Exception ex) { toolStripStatusLabel1.Text = ex.Message; } One --> how come the datagridview is missing a row all the time? two --> how do I get the picture to display in the datagridview? I will be adding something where they can print the information in this format: FirstName LastNAme Address City, State Zip Home Phone, Cell Phone, Fax I will get to this later, I am goign to try to figure that one out myself, but with the datagridview and the picture I have been messing with for a while and can just not figure it out.. Thanks
-
Hello I am new to this forum... I have a quick question... well I've created a Address Book, basically as my first program that I want to show my family.. On the first form it is all textboxes, datatimepicker, and a picturebox. You click the menu to open the DataGrid form I created.. in this I have a DataGridView. I have two problems. The DataGridView is always missing the first row of data. ID is the primary key and auto increments. It is always missing the first one... Also how do I get the table to display the image they chose with the person they added? I have the column as a image column but it will not display. The Picturebox is in the database. Here is how they load the picture: try { DialogResult result = new DialogResult(); OpenFileDialog openfile = new OpenFileDialog(); result = openfile.ShowDialog(); if (result == DialogResult.Cancel) { return; } else { picturePictureBox.Image = Image.FromFile(openfile.FileName); } } catch (Exception ex) { toolStripStatusLabel1.Text = ex.Message; } One --> how come the datagridview is missing a row all the time? two --> how do I get the picture to display in the datagridview? I will be adding something where they can print the information in this format: FirstName LastNAme Address City, State Zip Home Phone, Cell Phone, Fax I will get to this later, I am goign to try to figure that one out myself, but with the datagridview and the picture I have been messing with for a while and can just not figure it out.. Thanks
-
Hi,
two --> how do I get the picture to display in the datagridview?
maybe this can help you
sorry, i forgot the Link http://msdn2.microsoft.com/de-de/library/system.windows.forms.listview.sorting(VS.80).aspx[] Greetings cola 1973 :)