Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CRC32 returns negative on big files
Message
From
31/07/2011 11:47:37
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01519635
Message ID:
01519748
Views:
23
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform