<\/span><\/h2>\n\n\n\n \/\/Populate Datagridview On Form Load\n Image firstImage = Image.FromFile("C:\/Users\/Public\/Pictures\/Sample Pictures\/Chrysanthemum.jpg");\n byte[] imageAsByte = imageToByteArray(firstImage);\n dataGridView1.Rows.Add("Maurice", "Samantha", "Male", "United States Of America", "C:\/Users\/Public\/Pictures\/Sample Pictures\/Chrysanthemum.jpg", imageAsByte);\n Image secondImage = Image.FromFile("C:\/Users\/Public\/Pictures\/Sample Pictures\/Desert.jpg");\n byte[] imageAsByte2 = imageToByteArray(secondImage);\n dataGridView1.Rows.Add("Maurice", "Samantha", "Male", "United States Of America", "C:\/Users\/Public\/Pictures\/Sample Pictures\/Desert.jpg", imageAsByte2);\n Image thirdImage = Image.FromFile("C:\/Users\/Public\/Pictures\/Sample Pictures\/Hydrangeas.jpg");\n byte[] imageAsByte3 = imageToByteArray(thirdImage);\n dataGridView1.Rows.Add("Maurice", "Samantha", "Male", "United States Of America", "C:\/Users\/Public\/Pictures\/Sample Pictures\/Hydrangeas.jpg", imageAsByte3);\n Image fourthImage = Image.FromFile("C:\/Users\/Public\/Pictures\/Sample Pictures\/Jellyfish.jpg");\n byte[] imageAsByte4 = imageToByteArray(fourthImage);\n dataGridView1.Rows.Add("Maurice", "Samantha", "Male", "United States Of America", "C:\/Users\/Public\/Pictures\/Sample Pictures\/Jellyfish.jpg", imageAsByte4);\n Image fifthImage = Image.FromFile("C:\/Users\/Public\/Pictures\/Sample Pictures\/Koala.jpg");\n byte[] imageAsByte5 = imageToByteArray(fifthImage);\n dataGridView1.Rows.Add("Maurice", "Samantha", "Male", "United States Of America", "C:\/Users\/Public\/Pictures\/Sample Pictures\/Koala.jpg", imageAsByte5);\n\n<\/pre>\n\n\n\n<\/span>CONVERTING IMAGE TO BYTE ARRAY SOURCE CODE<\/span><\/h2>\n\n\n\n \/\/Converting Image To Byte Array Function\n public byte[] imageToByteArray(Image image)\n {\n\n MemoryStream ms = new MemoryStream();\n image.Save(ms, image.RawFormat);\n return ms.ToArray();\n }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"How To Populate DataGridView With Static Data In C# C# SOURCE CODE CONVERTING IMAGE TO BYTE ARRAY SOURCE CODE<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/1983"}],"collection":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/comments?post=1983"}],"version-history":[{"count":0,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/1983\/revisions"}],"wp:attachment":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/media?parent=1983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/categories?post=1983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/tags?post=1983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}