Hello! Hello! What magic words are required to have questions answered.

  • Thread starter Thread starter Burton Wilkins
  • Start date Start date
B

Burton Wilkins

Gentlemen:

How is it that some get their questions answered, and
others don't? If there is a "do-not-answer" list, and my
name is on it, would you please take my name off it? I'm
asking some serious questions on Byte arrays. Could
someone please respond?

I am building a general tool that should be able to read
and write all SQL Server datatypes. Presently, I am
working on that section of the program that reads and
writes Images. Going to the helps that come with .Net, I
find that Image map to an array of Bytes. Checking other
SQL DataTypes, I find that there are other SQL DataTypes
which map to an array of Bytes as well. Those datatypes
that apparently map to an array of Bytes are the
following: Binary, Image, TimeStamp, and VarBinary. My
first question, are all four of these datatypes considered
BLOBs? Are their other SQL Datatypes besides these four
that would map to arrays of Bytes, and are considered
Blobs?

Now, going to MSDN (Article 317044), I find that to read
or write an Image, one uses "the Microsoft SQL Server
READTEXT and UPDATETEXT statements to read and write data
from BLOB (LongVarBinary) columns in a database table."
The article further states that "Unlike with ADO 2.6 and
later, ADO.NET does not support reading and writing BLOB
objects by using Stream objects. ADO.NET data providers do
not have GetChunk and AppendChunk methods available to the
Data Access Object (DAO) and ActiveX Data Objects (ADO)
Recordset objects. To read a BLOB field for in-memory
manipulation, you can use a DataReader object to select
the row, or you can cache the data in a DataSet.
However, if you want to stream the data to a different
medium, such as disk or Web response, then you can read
the BLOB from the server in smaller chunks to minimize the
amount of memory that the process consumes."

Now my second question is, besides Images is this ALSO the
suggested approach for reading and writing Binary,
TimeStamp, and VarBinary datatypes to and from SQL
databases, or could one safely read or write Binary,
TimeStamp, and VarBinary with a "SELECT" and "UPDATE" SQL
statement? What then is the recommended approach, the
one that will most likely produce success all the time
reading and writing arrays of Bytes in ADO.Net?

Thank you in advance for answering this three general
question.

Sincerely,

Burton G. Wilkins.
 
Some newsgroups have more MVPs (and other knowledgeable posters) than
others.
I remember when the Access newsgroups had tons of unanswered questions.
Now, most of them get answered.

Some topics are easier to answer than others too.

You are much more likely to get a response to a single question.
(I routinely skip over multiple questions in a thread in other groups.)

Also, if a question has been responded to (even if the answer isn't valid)
then many people assume it was correctly answered and skip over it. (there
are a lot of quesitons out there and not enough time to review them all!!!)

Since this post has been "responded to" I suggest you form a single question
with a shorter background and try posting that. Then post the others a bit
later.
 
THose are all blobs. I didn't think Timestamp was a blob, but I'm not
sure....I'd go with the article on this one.

Yes, that's definitely a solid approach. Without using Streams, I'm not
really sure how you could get binary data like that into our out of the DB.

Good Luck,

Bill
 
William Ryan said:
THose are all blobs. I didn't think Timestamp was a blob, but I'm not
sure....I'd go with the article on this one.

Yes, that's definitely a solid approach. Without using Streams, I'm not
really sure how you could get binary data like that into our out of the
DB.

A timestamp can be read using a DataSet. It will then be converted into a
Base64String. If you're doing updates manually, then you'll have to convert
the Base64String like

DataRow r = dataset.Tables[0].Rows[0];
parameters[4].Value = Convert.FromBase64String (r[4].ToString ()); //
assuming this is the row/column where the timestamp value resides.

I would think this approach would work for VarBinary as well, especially
since the DataAdapter wizard declares timestamps to be VarBinary.

E.M.
 
Back
Top