Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,153,248 members, 7,818,843 topics. Date: Monday, 06 May 2024 at 06:27 AM |
Nairaland Forum / Science/Technology / Programming / Vb.net Save Picture (3108 Views)
I Need A Help To Write A Simple Login Form Using Vb.net / Vb.net Crystal Report & Dataset / Post Ur Vb 6.0 Questions Here (2) (3) (4)
Vb.net Save Picture by bigafees: 3:14pm On Dec 05, 2011 |
D N'lander, i used odbc connection for my sql server in vb.net, pls with ds i need code to save picture into database |
Re: Vb.net Save Picture by IOludayo(m): 12:52pm On Dec 06, 2011 |
I'm new 2 VB.NET n I nd e-books n mentorship. |
Re: Vb.net Save Picture by 9ja4eva: 8:48pm On Jan 20, 2012 |
Any VB pro in here please?I need some help |
Re: Vb.net Save Picture by samm(m): 10:08am On Jan 21, 2012 |
Using the code below. I'm assuming you have added an image control (ImageControl) and assigned and image to the control on your form. Also, I'm assuming you have created a sql server table with a column type of image. To save to SQL Server you have to save image to MemoryStream array(ms) then assign to SQL parameter value (image). Dim ms As New MemoryStream() Me.ImageControl.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg) spCommand.Parameters.AddWithValue("@image", ms.ToArray()) spCommand.ExecuteNonQuery() Your sql script look like this: INSERT INTO ImageTable(imagecol) VALUES (@image) Let me know if you have any more questions. |
(1) (Reply)
Help I"m Loosing Intrest Fast In Learning Programming. / Learn Programming For Free, Right From Your Couch! / Hi. Pls Help Me Review My Start-up
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 41 |