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. Data Types from Datareader

Data Types from Datareader

Scheduled Pinned Locked Moved C#
questioncsharphtml
4 Posts 4 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.
  • U Offline
    U Offline
    Unsy
    wrote on last edited by
    #1

    Hi guys I'm quite new to c# I'm writing a little jobby to spit the contents of a SqlDataReader out into an HTML table as a string. How can I find the datatype of each field in the data reader so that I can format it correctly? (dates, money etc) Thanks :-D

    If your wife wants to learn to drive, don't stand in her way...

    P L R 3 Replies Last reply
    0
    • U Unsy

      Hi guys I'm quite new to c# I'm writing a little jobby to spit the contents of a SqlDataReader out into an HTML table as a string. How can I find the datatype of each field in the data reader so that I can format it correctly? (dates, money etc) Thanks :-D

      If your wife wants to learn to drive, don't stand in her way...

      P Offline
      P Offline
      Prosanta Kundu online
      wrote on last edited by
      #2

      SqlDataReader.GetDataTypeName : Gets a string representing the data type of the specified column

      1 Reply Last reply
      0
      • U Unsy

        Hi guys I'm quite new to c# I'm writing a little jobby to spit the contents of a SqlDataReader out into an HTML table as a string. How can I find the datatype of each field in the data reader so that I can format it correctly? (dates, money etc) Thanks :-D

        If your wife wants to learn to drive, don't stand in her way...

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Try...

        dataReader1.GetFieldType(0)

        HTH

        Jinal Desai - LIVE Experience is mother of sage....

        1 Reply Last reply
        0
        • U Unsy

          Hi guys I'm quite new to c# I'm writing a little jobby to spit the contents of a SqlDataReader out into an HTML table as a string. How can I find the datatype of each field in the data reader so that I can format it correctly? (dates, money etc) Thanks :-D

          If your wife wants to learn to drive, don't stand in her way...

          R Offline
          R Offline
          riced
          wrote on last edited by
          #4

          Unsy wrote:

          a little jobby

          You're not in Scotland, are you? This has quite a different meaning there. Although it's usually referred to as 'a wee jobby'. :)

          Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.

          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