Long Varchar Field Driving Me Batty in C#!

I’m trying to retrieve a Long Varchar column from a Sybase Adaptive Server Anywhere 9 database in a C# client application using the .NET OleDB libraries.

I’ve tried both OleDBDataReader and OleDBDataAdapter.  I don’t get an error when executing the query, but when attempting to retrieve the Long Varchar field, I get a length of zero from the DB using OleDBDataReader.GetChars, and when attempting to cast into a string, I end up with the empty string.

If I shorten the data in the field to 20 or 30 characters, it works.  But at some threshold, the data is too big and I can’t retrieve the data.  The data I’m trying to retrieve is around 10,000 characters.

Any ideas?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joe WoodhousePrincipal ConsultantCommented:
Double-check your driver versions. Older versions may not support more recent additions like large character types. I've seen numerics beyond a certain size truncated in earlier versions of the ASE drivers, for instance.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Take a look here for your connections string and it will point you the ASE ADO.NET guide as well:


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Sybase Database

From novice to tech pro — start learning today.