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
  1. Home
  2. General Programming
  3. C#
  4. Get the exact data types from a sql table

Get the exact data types from a sql table

Scheduled Pinned Locked Moved C#
csharpdatabasecomtoolsquestion
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.
  • I Offline
    I Offline
    Ista
    wrote on last edited by
    #1

    Is there a way I can extract the extact data type strings but sql via ADO.NET. I need to know the exact name of the data type from sql. I tried creating a data table and filling it, then examining the columns. But, only gives me a .net data type. For instance, smalldatetime is converted to DateTime. I need to know what it is before the conversion. thanks nick

    -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

    M 1 Reply Last reply
    0
    • I Ista

      Is there a way I can extract the extact data type strings but sql via ADO.NET. I need to know the exact name of the data type from sql. I tried creating a data table and filling it, then examining the columns. But, only gives me a .net data type. For instance, smalldatetime is converted to DateTime. I need to know what it is before the conversion. thanks nick

      -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

      M Offline
      M Offline
      mikone
      wrote on last edited by
      #2

      you could try to perform a query which shows you the tables structure ( MySQL: desc Tablename; - Firebird: show table Tablename; ) and parse the result in your programm. That way you would get the name of the datatypes used by your database.

      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