Long Varchar Field Driving Me Batty in C#!

Posted on 2006-04-17
Last Modified: 2010-05-18

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?
Question by:PegasusAloft
    LVL 24

    Accepted Solution

    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.
    LVL 29

    Assisted Solution

    Take a look here for your connections string and it will point you the ASE ADO.NET guide as well:


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Title # Comments Views Activity
    finding which fields are "nullable" 4 668
    Sybase - CronJob schedule 2 572
    SQL Syntax 6 378
    the error when installation Sybase ASE 15.7 x64 bon Windows 37 2,456
    DECT technology has become a popular standard for wireless voice communication. DECT devices are not likely to be affected by other electronic devices and signals because they operate in a separate frequency-band.
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now