Variant data type

E

empire5

I'm trying to convert a MS-Sql 6.5 VB application to SQL 2005 and vb.net.

The vb app has uses a variant data type. When I try to read the variant data
type from the sql 2005 database I get 8,000 characters into the variant
type, however when I use the 6.5 database I get only the limited number of
characters that are actually in the column.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

empire5 said:
I'm trying to convert a MS-Sql 6.5 VB application to SQL 2005 and vb.net.

The vb app has uses a variant data type. When I try to read the variant data
type from the sql 2005 database I get 8,000 characters into the variant
type, however when I use the 6.5 database I get only the limited number of
characters that are actually in the column.

What exactly is the data type, and what do you do to read it?
 
C

Cor Ligthert[MVP]

Hi,

Are you sure you are working with dotNet (VB.Net), VB does not use the
variant types in versions from this millenium. (Probably your SQL field
would be in SQL server from the Text type or another blob type).

Cor
 
K

Kevin Spencer

I take it you're talking about some sort of string data, correct? SQL Server
7.0 and later use Unicode characters by default. A Unicode character has
more than one byte. I would also suggest that you use a System.String to
read the data into. The only "equivalent" of a variant in the .Net Framework
is the System.Object class, and there are good reasons for using strong
typing.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top