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. Web Development
  3. ASP.NET
  4. retiveig columns

retiveig columns

Scheduled Pinned Locked Moved ASP.NET
sharepointhelptutorial
3 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.
  • Y Offline
    Y Offline
    yuvachandra
    wrote on last edited by
    #1

    hi all.... plz let me know how to retrieve the column names of a given table.....without content(data),just only column names not like select * from sometable and sp_help sometable Plz help me,,thanqs in advance :rose:

    J 1 Reply Last reply
    0
    • Y yuvachandra

      hi all.... plz let me know how to retrieve the column names of a given table.....without content(data),just only column names not like select * from sometable and sp_help sometable Plz help me,,thanqs in advance :rose:

      J Offline
      J Offline
      JustChiragPatel
      wrote on last edited by
      #2

      Hi, how are you..? you should try this... use this for loop for getting names of all columns in table... DataTable dt = new DataTable(); string[] columnsNames = new string[dt.Columns.Count]; for (int i = 0; i < dt.Columns.Count; i++) { columnsNames[i] = dt.Columns[i].ColumnName.ToString(); } Bye ...

      Chirag Patel

      Y 1 Reply Last reply
      0
      • J JustChiragPatel

        Hi, how are you..? you should try this... use this for loop for getting names of all columns in table... DataTable dt = new DataTable(); string[] columnsNames = new string[dt.Columns.Count]; for (int i = 0; i < dt.Columns.Count; i++) { columnsNames[i] = dt.Columns[i].ColumnName.ToString(); } Bye ...

        Chirag Patel

        Y Offline
        Y Offline
        yuvachandra
        wrote on last edited by
        #3

        hi patel....thanqs,,the code snippet worked for me

        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