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

Read SQL Server LongVarChar (text) Feild

P: n/a
Hi All

I am trying to read a LongVarChar field from SQL Server using the
SqlDataReader and I am having trouble. Can anyone provide an example or
assistance.

I found the article
http://support.microsoft.com/default...b;en-us;316887 to read
LongVarBinary fields but I have been unable to convert this example to read a
text field, as I get the error "Specified cast is not valid.".

Any assistance would be appreciated.

Thanks
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
David,

Normally you can use simple the CStr or the toString in my opinion.

However for this purpose are in my opinion the type convert functions from
Visual Basic very strong tools which stands to our purpose. For me is this
one of the great benefits from VBNet. (They are probably not so often used
in samples on MSDN because they are specific to VBNet however a full part of
the framework).

http://msdn.microsoft.com/library/de...Conversion.asp
I hope this helps?

Cor

"David" <Da***@discussions.microsoft.com>
Hi All

I am trying to read a LongVarChar field from SQL Server using the
SqlDataReader and I am having trouble. Can anyone provide an example or
assistance.

I found the article
http://support.microsoft.com/default...b;en-us;316887 to read
LongVarBinary fields but I have been unable to convert this example to
read a
text field, as I get the error "Specified cast is not valid.".

Any assistance would be appreciated.

Thanks

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.