Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

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
 
Share this answer
 
look this images in sql[^]
 
Share this answer
 
view this link and study it.. Surely it will help for you...

http://programtechn.blogspot.in/[^]
 
Share this answer
 
VB
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
 
Share this answer
 
v4

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900