Read SQL Server LongVarChar (text) Feild

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.aspx?scid=kb;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
 
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/default.asp?url=/library/en-us/vblr7/html/vaGrpTypeConversion.asp


I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top