473,378 Members | 1,369 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,378 software developers and data experts.

Variant data type

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.
Sep 16 '07 #1
2 2122
empire5 wrote:
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?

--
Göran Andersson
_____
http://www.guffa.com
Sep 16 '07 #2
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

"empire5" <a@b.comwrote in message
news:46***********************@roadrunner.com...
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.


Sep 17 '07 #3

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

Similar topics

1
by: C. N. Sridhar | last post by:
Hi, I'm writing a wrapper to a win32 dll in C#. I need to call a method in DLL which has a Variant type reference parameter. How to marshal variant type from win32 (unmanaged code) to C#...
8
by: MLH | last post by:
If I choose to dim MyDate as Date or MyDate as Variant, what is the most significant difference between the two choices?
19
by: Jon Davis | last post by:
Hi guys! Just wanted to let you all know that I created a Variant structure, inspired by the old VB6 days. This is written in C#, but you can build a CLR/.NET class library assembly and reference...
7
by: Tracks | last post by:
I have old legacy code from vb5 where data was written to a file with a variant declaration (this was actually a coding error?)... in vb5 the code was: Dim thisdata as integer Dim thatdata...
3
by: G Gerard | last post by:
Hello If Variant type is the data type that contains any kind of data type is there a reason why one would not always use Variant when declaring variables? Thanks G Gerard
1
by: darrenbenn | last post by:
I need to convert this code to VB .NET (2003). Dim FaxMsg As IFaxMessage Set FaxMsg = gFC.NewMessage Dim Recip As Variant ' add a recipient to the fax recipients collection Set Recip =...
4
by: buzzluck68 | last post by:
Hello, I am having trouble upgrading my VB apps to .net. When i started at my company there was a dll created here in vb6, and i need to use that dll for many functions that would take too much...
2
by: bloukopkoggelmander | last post by:
Hi all I am getting the following error and it is driving me insane. I just cannot find a fix for it. : You tried to assign the NULL value to a variable that is not a Variant data type. Now...
3
by: empire5 | last post by:
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...
1
by: captainc | last post by:
I have C++ code to import a .tlb and use a .dll that has functions that return VARIANT types and accepts BSTRs (bstrings). I have seen that python has modules that can manipulate VARIANTs and BSTRs...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.