Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Strange problem with GetSchemaTable and utf8

Strange problem with GetSchemaTable and utf8

Scheduled Pinned Locked Moved C#
databaseoraclehelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stofel
    wrote on last edited by
    #1

    Hi, I have a problem with an oracle DB which is installed with an utf8-characterset. I build a form in VS2005 where the user type in a SQL-selectstatement and the form executes it and displays the result. Everything works fine with a singlebytecharcterset. For example:

    String sqltext = "Select artext from tbl_ar"; // artext is
    // varchar2(30 char)
    DataTable schTable;
    OracleDataReader rdr = null;

    OracleCommand cmd = new OracleCommand (sqltext, OracleConnection, OracleTransaction);
    rdr = cmd.ExecuteReader(CommandBehavior.KeyInfo);
    schTable = rdr.GetSchemaTable(); // Here the DataTable is filled with the
    // information of the columns
    DataRow fldDescr = schTable.Rows[0];
    int len = (int) fldDescr[2]; // 2 = ColumnSize

    In the database with the utf8-characterset the variable len hat the value 0f 90 instead of 30. Is there a way to get the correct result ? Thanks in advanced Stofel

    W 1 Reply Last reply
    0
    • S stofel

      Hi, I have a problem with an oracle DB which is installed with an utf8-characterset. I build a form in VS2005 where the user type in a SQL-selectstatement and the form executes it and displays the result. Everything works fine with a singlebytecharcterset. For example:

      String sqltext = "Select artext from tbl_ar"; // artext is
      // varchar2(30 char)
      DataTable schTable;
      OracleDataReader rdr = null;

      OracleCommand cmd = new OracleCommand (sqltext, OracleConnection, OracleTransaction);
      rdr = cmd.ExecuteReader(CommandBehavior.KeyInfo);
      schTable = rdr.GetSchemaTable(); // Here the DataTable is filled with the
      // information of the columns
      DataRow fldDescr = schTable.Rows[0];
      int len = (int) fldDescr[2]; // 2 = ColumnSize

      In the database with the utf8-characterset the variable len hat the value 0f 90 instead of 30. Is there a way to get the correct result ? Thanks in advanced Stofel

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Hi, Check that your character set is compatible at client side (HKEY_LOCAL_MACHINE\Software\Oracle....) Mika

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups