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. Visual Basic
  4. get column names

get column names

Scheduled Pinned Locked Moved Visual Basic
databasetutorialquestion
3 Posts 3 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.
  • C Offline
    C Offline
    Cory Kimble
    wrote on last edited by
    #1

    I need to know how to get the column names of a database. I want to offer my users the ability to choose a database from a list of databases and then have them select what columns they want. I want to know how to get the column names and store them in a combobox. Does anyone know how to do this or where I can find an article? Thank you.

    A 1 Reply Last reply
    0
    • C Cory Kimble

      I need to know how to get the column names of a database. I want to offer my users the ability to choose a database from a list of databases and then have them select what columns they want. I want to know how to get the column names and store them in a combobox. Does anyone know how to do this or where I can find an article? Thank you.

      A Offline
      A Offline
      atregent
      wrote on last edited by
      #2

      This is from something I wrote a while back for checking the structure of an Access table, it might be of some help to point you in the right direction: Dim tblExport As DataTable Dim TableName as string = "tblTest" tblExport = TestConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, TableName, "TABLE"})

      R 1 Reply Last reply
      0
      • A atregent

        This is from something I wrote a while back for checking the structure of an Access table, it might be of some help to point you in the right direction: Dim tblExport As DataTable Dim TableName as string = "tblTest" tblExport = TestConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, TableName, "TABLE"})

        R Offline
        R Offline
        ReactiveX
        wrote on last edited by
        #3

        The Microsoft SQL Server equivalent is: SELECT syscolumns.name FROM syscolumns INNER JOIN sysobjects ON syscolumns.id = sysobjects.id WHERE sysobjects.name = ''

        Daniel Minnaar .NET Solutions Architect

        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