Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CRC32 returns negative on big files
Message
De
31/07/2011 11:47:37
 
 
À
30/07/2011 14:25:29
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01519635
Message ID:
01519748
Vues:
24
>>Well, I put it on and ended up with a bunch of errors where I would no longer be able to do things like:
>>
>>
>>Private cName As String = ""
>>cName = Trim(toRow("Table"))
>>
>>
>>As, it would give errors like:
>>
>>"Option Strict On disallows implicit conversions from 'Object' to 'String'."
>
>That's what it supposed to do. It's complaining because you are attempting to apply the Trim() function to a type that may not be a string - a source for potential exceptions. If you are sure the toRow("Table") is indeed a string then you can make the compiler relax by doing an explicit conversion. You could, in practice, still end up with the error - but it would be entirely your fault :-}


Even better than an explicit cast to a string is to use the .ToString() method ... of course, I'm assuming that toRow is a DataRow. <g>

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform