Results 1 to 6 of 6

Thread: ODBC and large data

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Posts
    16

    ODBC and large data

    I'm having this problem with my ODBC database objects. I have a field in the database that stores 2000 characters. However, whenever I extract very long data from it using Microsoft.Data.Odbc objects, I get an incomplete data.

    Example, say I have a record in the database wherein that field contains 500 characters. When I retrieve it, I only get the first 25 characters.

    Any ideas? Is there a way I can configure my ODBC driver to handle larger data? Thanks in advance.

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Anything under 4k is not an ODBC driver issue.

    What database is it stored on and what is the code that does the extraction?
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Posts
    16
    The database is Interbase. I think it's not a database problem because when I tried querying the data directly from Interbase, it returns the entire string.

    Anyway, here's the code:

    public DataSet GetRemarks(string sku, long entryDate)
    {
    connection.Open();
    OdbcCommand cmd = new OdbcCommand();
    cmd.Connection = connection;
    cmd.CommandText = "SELECT * FROM " + TableName + " " +
    "WHERE " + Fields.EntryDate + " = " + entryDate +
    "AND " + Fields.SKU + " = '" + sku + "' "+
    "ORDER BY " + Fields.EntryDate + ", " + Fields.LineNum;

    OdbcDataAdapter da = new OdbcDataAdapter(cmd);
    OdbcDataReader dr = cmd.ExecuteReader();
    while (dr.Read())
    {
    Console.WriteLine(dr.GetString(5));
    }
    return dr;
    }

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Posts
    16
    The database is Interbase. I think it's not a database problem because when I tried querying the data directly from Interbase, it returns the entire string.

    Anyway, here's the code:

    public DataSet GetRemarks(string sku, long entryDate)
    {
    connection.Open();
    OdbcCommand cmd = new OdbcCommand();
    cmd.Connection = connection;
    cmd.CommandText = "SELECT * FROM " + TableName + " " +
    "WHERE " + Fields.EntryDate + " = " + entryDate +
    "AND " + Fields.SKU + " = '" + sku + "' "+
    "ORDER BY " + Fields.EntryDate + ", " + Fields.LineNum;

    OdbcDataAdapter da = new OdbcDataAdapter(cmd);
    OdbcDataReader dr = cmd.ExecuteReader();
    while (dr.Read())
    {
    Console.WriteLine(dr.GetString(5));
    }
    return dr;
    }

  5. #5
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Place a break point on your console.writeline and when it breaks there, add a watch to your dr object.

    Does the watch show the full text within the object?
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Posts
    16
    yes. i already tried that. it does not show the full text. that's the reason why i thought it's related with the odbc driver. because immediately after retrieving the records from the database using odbc objects, the large strings surprisingly become shortened.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width