473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

not properly updating image from DataGridView in winform application

I have a DataGridView, which has a image column:
Update Button_Click:
Expand|Select|Wrap|Line Numbers
  1.  Dim dtimage As Image
  2.     {
  3.         using (MemoryStream ms = new MemoryStream(rv.Row.Field<byte[]>("empimage"))) {
  4.             dtimage = new Bitmap(ms);
  5.         }
  6.     }
Update query:
Expand|Select|Wrap|Line Numbers
  1. adapter.UpdateCommand == new SqlCommand("update DepartmentMaster_tbl set dtName = @dtName,dtPhone = @dtPhone,dtEmail = @dtEmail,empimage=@dtimage  where dtId=@dtid", con.connect)
Then I'am converting the image, so that I can save it to my SQL-Server
Expand|Select|Wrap|Line Numbers
  1. MemoryStream md = new MemoryStream();
  2. dtimage.Save(md, System.Drawing.Imaging.ImageFormat.Gif);
  3. byte[] bmpBytes = md.GetBuffer();
  4. adapter.UpdateCommand.Parameters.AddWithValue("@dtimage", bmpBytes);
  5. adapter.UpdateCommand.ExecuteNonQuery();
I'm not getting any error after executing this. The image is saved as some black color:[IMG]

[/IMG]
Jan 29 '14 #1
0 1001

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: charbonneau | last post by:
I need to develop a WinForm application which can play .mp3 music files stored on another machine on a LAN. This applicaiton needs to run on servaral different client machines at the same time. I...
1
by: Pramod Thewarkar | last post by:
Hi, I have deployed my winform application on iis server in a virtual directory. On the start of my application, it is reading some information from the config file (app.config). When i am...
9
by: Dayne | last post by:
I need to have a auto timeout feature for a webform application(vb.net). Basically, I want to close the application if the user does not have a keyboard or mouse input after a specific period of...
0
by: Cenray | last post by:
How to generate a web request from a Winform Application using a WebService? In a C# Windows Application, when I try to genrate a web request using the following code, it is woking fine ...
1
by: Ollie Riches | last post by:
Does anyone know a way to create a winform window that has similiar functionality to the 'Output' window in VS .Net - i.e. that basically acts like a console window but is proper MDI child of the...
6
by: QuenHo | last post by:
Hi All, I've build a winform application with vb.net which accepts command-line parameters. If I tell windows to open certain files with this application all works fine, but windows does NOT...
0
by: Litani | last post by:
Hi everyone, We have a winform application that uses webservices. It has list screens. The user selects a row from the grid and an edit screen is presented to the user with the selected row. ...
4
by: amgogalla | last post by:
Hi folks, i want ur help for finding the way to call the JAVA API which has commands(helps to communicate a windows application with mainframes application) into .net (winforms) application. we...
0
by: kzWS08 | last post by:
Hello... I have a quick query. Hope someone can help. I have a winform application which uses the Arial Unicode MS font. Is it ok to include the *.ttf font file in my installer? Are there any licence...
0
by: jaseem0712 | last post by:
I have a data grid view like this: http://bytes.com/attachment.php?attachmentid=7458&stc=1&d=1390739933 i am loading data grid view like this: Dim cd As SqlCommandBuilder = New...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.