I have a sql table that hold binary files as blobs. Our customers store
attachments for their work orders in them, anything from xml files to zip
files. Normally, these files first exist on the hard drive and are converted
to a byte array and saved to the database in an image type field.
Four the web version of this, our customers will be entering text into a
form and when the form is submitted, the text will be saved to a simple
string variable.
I need to them convert that string var into a byte array to allow it to be
saved to the database, just as if it were a text file.
I know how to do this using an actual file, but my brain is not letting me
make the leap to using a string var, instead of the file.
What's the best way to do this? Oh, and I can't just save it as a varchar in
the db because later on, in the client application, it will be looking to
take the data and create an actual text file on an end user's hard drive.
Thanks 2 2000
Jon wrote:
[snip] I need to them convert that string var into a byte array
Encoding.GetByt es:
Encodes all or part of a specified String or character array into a
byte array.
Now, choosing *which* Encoding to use is the interesting bit.
ASCIIEncoding might be appropriate, if the text is pure 7 bit. Or maybe
Encoding.Defaul t if your codepage is constant. Or Encoding.Unicod e to
be absolutely sure.
--
Larry Lard
Replies to group please
Jon,
In my idea is the best way to do this to encapsulate both in a
dataset/datatable.
Have a look at this sample on our website
(the text field is not yet added, however that is of course a piece of cake) http://www.windowsformsdatagridhelp....-dd138c31a825I hope this helps,Cor"Jon" <ru******@msn.c om> schreef in berichtnews:%2* *************** @TK2MSFTNGP10.p hx.gbl...>I have a sql table that hold binary files as blobs. Our customers storeattachment s for their work orders in them, anything from xml files to zipfiles. Normally, these files first exist on the hard drive and are convertedto a byte array and saved to the database in an image type field.>> Four the web version of this, our customers will be entering text into aform and when the form is submitted, the text will be saved to a simplestring variable.>> I need to them convert that string var into a byte array to allow it to besaved to the database, just as if it were a text file.>> I know how to do this using an actual file, but my brain is not letting memake the leap to using a string var, instead of the file.>> What's the best way to do this? Oh, and I can't just save it as a varcharin the db because later on, in the client application, it will be looking totake the data and create an actual text file on an end user's hard drive.>> Thanks> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Rolf Hemmerling |
last post by:
Hello !
Beginner's question:
What ist the easiest way to store and save objects in a file generated
by a C++ program, by using the "standard C++ library" and/or "Standard
Template Library ( STL )" ?
So I would like to generate some objects ( of different classes ) with a
C++ program and would like to make it permanent / persistent, so that
|
by: Tron Thomas |
last post by:
What does binary mode for an ofstream object do anyway? Despite which
mode the stream uses, operator << writes numeric value as their ASCII
representation.
I read on the Internet that it is possible to change the behavior of
operator << so it will stream numeric values as their actual values
when an ofstream is in binary mode. I did not, however, find any
information on how this can be accomplished. What is involved in
getting this...
|
by: gnv |
last post by:
Hi all,
I am writing a cross-browser(i.e. 6 and netscape 7.1) javascript
program to save an XML file to local file system.
I have an xml string like below:
var xmlStr = "<?xml version="1.0" encoding="UTF-8"?><a>some info</a>";
I want to save this xml file to local file system with JavaScript,
|
by: Wei Su |
last post by:
Hi,
I have a text file abc.txt and it looks like:
12 34 56
23 45 56
33 56 78
... .. ..
... .. ..
I want to get how many rows totally in the text file, how to do this?
Thanks.
|
by: Dave |
last post by:
Hello. I need to load an URL and save it to a file in Asp.Net. The
function below is creating the file, but isn't putting the data in it.
Also the data is binary, so I'm not sure if I need to fiddle with
encoding or whatnot.
Dave
Private Function GetURLSave(ByVal sURL As String,ByVal sFileName As
String) As Boolean
Dim oRequest As System.Net.HttpWebRequest =
| |
by: Niyazi |
last post by:
Hi,
I developed an application and I am using SQL Server 2000 developer edition.
I create my database and I have also created tbl_USER table.
I have an ID, RealName, UserName, and UserPassword fields.
I want to save UserName and UserPassword using bit or binary data type with
VB.NET. Then ofcourse I have to retrive them to compare it later and if I
find match than user can enter the MAIN forum.
|
by: Dale |
last post by:
I am creating GIF images with transparent backgrounds on-the-fly for a web
app and rendering them by using
System.Drawing.Image.Save(Response.OutputStream, ImageType.GIF).
I am confident that the transparency is working properly because if I save
the created image to the local hard disk and then view it in a web page or an
image editor, the transparency is correct. I can also view the transparency
on-the-fly in a Windows.Forms...
|
by: SveinErik |
last post by:
Hi, I'm trying to find a method to save bmp, jpg and png files as ico
files, 16x16 size. I have managed to convert and save bmp files to
icon, but only in 32x32 size. I can't figure out how to save it in the
size: 16x16, and I hope someone could help me out a bit?
Code that saves from bmp to ico (32x32):
private void cmdConvert_Click(object sender, EventArgs e)
{
string source = @"d:\image.bmp";
|
by: WayneBurrows |
last post by:
Can I save dynamically created data to a text file on the client's
machine?
Preferrably in a user named file through a save dialog box.
Thanks
Wayne
|
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...
|
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...
| |
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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();...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |