You can also get that error if you are trying to move the contents of a
database field which is null to a string variable. For instance:
myString = myDataRow(0)
If myDataRow(0) is null then you get the error. This is a very common
problem. If this is your problem then the solution is very simple. If you
add an empty string to the expression then the cast will take place
properly. This is the correct (and very trick) code.
myString = myDataRow(0) & ""
Regards
----- Original Message -----
From: <irfan.syed@g...>
To: "ASPX_Professional" <aspx_professional@p...>
Sent: Wednesday, March 05, 2003 3:23 AM
Subject: [aspx_professional] RE: VB6 to VB.Net Upgrade Error
Means you are assigning wrong data type to a variable. Use System.convert
class to convert the value before assigning it.
-----Original Message-----
From: Sachin Mhatre [mailto:sachinx@h...]
Sent: Wednesday, March 05, 2003 6:18 PM
To: ASPX_Professional
Subject: [aspx_professional] VB6 to VB.Net Upgrade Error
Hi,
After Upgrading a VB 6.0 Project to VB.Net I am getting following error in
form design. An error occured while loading the document. Fix the erro,
and thentry loading the document again. The error message
follows:Specified cast is not valid
What this error mean? and how to rectify?
- SachinCricket World Cup 2003
http://server1.msn.co.in/msnspecials/worldcup03/