473,787 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB (5or6) does something wierd with image data while saving to sql2000

Vb stores an image (bitmap/jpg) in a SQL2000 image field. For some
reason it doubles the size by adding 00 for each byte. But sometimes it
doesn't add 00 (0000.0000) but 01 or 20 or ?? and also the byte that
should be transferd is changed...
So SQLImageData = Imagebyte + 00
and sometimes
SQLImageData = CHANGEDImagebyt e + xx.

Some example data: (hex notation):

A1 => A1 00
03 => 03 00
-----------
91 => 18 20
83 => 92 01
8C => 52 01

Could anybody give me an explanation, because I need to know what is
happening, so I can remove te extra bytes added......

I have already a image when I remove the extra bytes, but with some
wrong data (on the place where things like 8C => 52 01 happen)....

Thx,
Geronimo

Apr 27 '06 #1
2 1426
geronimi (we******@hotma il.com) writes:
Vb stores an image (bitmap/jpg) in a SQL2000 image field. For some
reason it doubles the size by adding 00 for each byte. But sometimes it
doesn't add 00 (0000.0000) but 01 or 20 or ?? and also the byte that
should be transferd is changed...
So SQLImageData = Imagebyte + 00
and sometimes
SQLImageData = CHANGEDImagebyt e + xx.

Some example data: (hex notation):

A1 => A1 00
03 => 03 00
-----------
91 => 18 20
83 => 92 01
8C => 52 01

Could anybody give me an explanation, because I need to know what is
happening, so I can remove te extra bytes added......

I have already a image when I remove the extra bytes, but with some
wrong data (on the place where things like 8C => 52 01 happen)....


Without seeing your code it's difficult to assist at all. And in any case
you may be better off to ask in a group for Visual Basic.

If this is a third-party app, I would suggest that you contact the vendor.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 27 '06 #2
I found a solution!

I convert the data like this:
ImageData=Syste m.Text.UnicodeE ncoding.Convert (Encoding.Unico de,Encoding.Def *ault,ImageData );

and the picture is perfect!!
thx for the help!

Apr 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
12027
by: Alper Adatoz | last post by:
Hi, i have a little problem. i hope u guys give me a clear solution (: db: mssql i just want to put jpeg file to the image field at the mssql db. and after that i want to call it back..
0
1681
by: Umesh | last post by:
Hi, I have an Application, in which 1) need to post data to a URL(Remote Server), by using HTTPRequest. 2) get the Image data in the form of Stream in Response. 3) need to save this stream as a Image file on the local machine. Giving some code snippet below. RequestAPI = CType(WebRequest.Create(URLName), HttpWebRequest)
0
1140
by: Umesh | last post by:
Hi Gurus, I have an Application, in which 1) need to post data to a URL(Remote Server), by using HTTPRequest. 2) get the Image data in the form of Stream in Response. 3) need to save this stream as a Image file on the local machine. Giving some code snippet below. RequestAPI = CType(WebRequest.Create(URLName), HttpWebRequest)
2
1085
by: geronimi | last post by:
Vb stores an image (bitmap/jpg) in a SQL2000 image field. For some reason it doubles the size by adding 00 for each byte. But sometimes it doesn't add 00 (0000.0000) but 01 or 20 or ?? and also the byte that should be transferd is changed... So SQLImageData = Imagebyte + 00 and sometimes SQLImageData = CHANGEDImagebyte + xx. Some example data: (hex notation):
2
1692
by: PointMan | last post by:
i make a project in vs2005 that use ASPNETDB.MDF and use <asp:LoginView ID="LoginView1" runat="server" > server control for vs2005 in this case , i'd like to use hosting service but this hosting company does not support sql2005 that's why i have to use sql2000 so my quetion is how can i migration this for sql2000??
7
3512
by: jc | last post by:
Hello, a question for the MS Access community, from someone who programs with SQL in SQL2000. I currently create a table with varying column names and data within SQL2000. I then need to reproduce the same in a Access file DB. The normal functions available with SQL2000 such as OpenRowSet are good for Insert, Select etc., but not the simple "DDL" task of creating a table. Can another help/suggest ?
19
2436
by: active | last post by:
The ColorPalette class has no constructor so how does one use it? I define a variable by: Dim cp as ColorPalette but don't know how assign an object to the variable. Thanks in advance
2
2359
by: David Morgan | last post by:
Hi Guys I have been working with ASP for many years but have _never_ come across this. Sure, I've had the global.asa not execute because of application misconfiguration, but check this out... Server (W2K3 R2) reboots, website comes back up, but no application variables loaded. What makes it even more bizarre is that the variables that are set in
8
2383
by: JJ | last post by:
Whilst I am resizing images I am losing quality. This is only happening in small amounts, but if you repeatedly put the same image through the following code, the image quality slowly degrades. Can anyone spot why this may be happening? Should it only deteriate once upon intitially going through this procedure? The deterioration is subtle, but after a few iterations is quite noticeable..: private static System.Drawing.Image...
0
9655
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.