By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

CType()

P: n/a
does CType() provide any auto-conversions ... ?

for example, if i use

CType(rs!MyField,String)

will fields with nulls, or numerics, etc. be converted?

what's the fastest way to handle this type of thing ?

(assuming you are happy with a fixed set of auto-conversions)
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
* "John A Grandy" <johnagrandy-at-yahoo.com> scripsit:
does CType() provide any auto-conversions ... ?
It will do conversions which are defined for the datatype.
for example, if i use

CType(rs!MyField,String)

will fields with nulls, or numerics, etc. be converted?


No, 'DBNull.Value' cannot be converted to a string. You will have to
check the field's value and do the conversion yourself.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.