Click here to Skip to main content
11,431,829 members (58,813 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
How can I save Bitmap Images in SQL Server? My front end is vb.net...After the modification in image in the PictureBox,I need to save it in the Database..Please help me..
Posted 25-Jan-13 17:46pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It's unbearable to answer this question again and again; it's too often asked. Please, do this:
http://www.codeproject.com/search.aspx?doctypeid=5&q=SQL+%28images+OR+image%29[^].

Now, it looks like you modify images in PictureBox. Why, on Earth? You can do it, but it's totally pointless. This control is nothing but a shortcut used to do something very simple: show a static image on screen. If you do anything even a bit more complex, you simply do double work; and a computer also does double work. Control is not an image.

I'll tell you what to do instead. You should either render image in the control directly, or do in on a bitmap, and draw a bitmap of some control. It could be a custom control derived from System.Windows.Forms.Control, or Panel, or even Form. How? I'll explain that. Please see my past answers:
How do I clear a panel from old drawing[^],
draw a rectangle in C#[^],
Append a picture within picturebox[^].

See also:
Drawing Lines between mdi child forms[^],
capture the drawing on a panel[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
How to speed up my vb.net application?[^].

—SA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

look this images in sql[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

view this link and study it.. Surely it will help for you...

http://programtechn.blogspot.in/[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Dim eid As Integer
        If bm.Count = 0 Then
            eid = 1
        Else
            bm.Position = bm.Count - 1
            eid = CInt(TextBox2.Text) + 1
        End If
        bm.AddNew()
        TextBox2.Text = eid.ToString
        TextBox2.Enabled = False
 
        Dim OpenFileDialog1 As New OpenFileDialog
        With OpenFileDialog1
 
            .CheckFileExists = True
 
            .ShowReadOnly = False
 
            .Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg"
 
            .FilterIndex = 2
 
            If .ShowDialog = DialogResult.OK Then
 
                ' Load the specified file into a PictureBox control.

                pbNewImage.Image = Image.FromFile(.FileName)


Read more: http://ram-a-singh.blogspot.com/2011/10/how-to-add-image-in-ms-access-database.html
  Permalink  
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.150428.2 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100