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. Getting TableName in Tables of DataSet

Getting TableName in Tables of DataSet

Scheduled Pinned Locked Moved C#
questiondatabasesharepointsql-serversysadmin
4 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.
  • M Offline
    M Offline
    Maxim Langman
    wrote on last edited by
    #1

    Hello, I have a little Stored Procedure (SQL Server 2005), which returns some tables. Now, I'm getting those tables in the DataSet in my code. The problem is that I'm not getting TableName of none of the tables. All I get is a default naming convention "Table", Table1", Table2" .... What is the way to get the TableName from SP? How can I basically know which table represents which select in the SP? Thanks, Maxim

    P 1 Reply Last reply
    0
    • M Maxim Langman

      Hello, I have a little Stored Procedure (SQL Server 2005), which returns some tables. Now, I'm getting those tables in the DataSet in my code. The problem is that I'm not getting TableName of none of the tables. All I get is a default naming convention "Table", Table1", Table2" .... What is the way to get the TableName from SP? How can I basically know which table represents which select in the SP? Thanks, Maxim

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      You can't.

      M 1 Reply Last reply
      0
      • P PIEBALDconsult

        You can't.

        M Offline
        M Offline
        Maxim Langman
        wrote on last edited by
        #3

        What do you mean: "you can't"? There has to be some proper way to get tables named then counting them in the SP and then reading them like myDataSet.Tables[5]. And what if SP has been changed? Will I have to recompile the whole project? BTW, If I can't then why do I need this property "TableName" at all?

        modified on Tuesday, March 3, 2009 1:55 AM

        P 1 Reply Last reply
        0
        • M Maxim Langman

          What do you mean: "you can't"? There has to be some proper way to get tables named then counting them in the SP and then reading them like myDataSet.Tables[5]. And what if SP has been changed? Will I have to recompile the whole project? BTW, If I can't then why do I need this property "TableName" at all?

          modified on Tuesday, March 3, 2009 1:55 AM

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Maxim Langman wrote:

          There has to be some proper way to get tables named

          There isn't. There can't be.

          Maxim Langman wrote:

          then why do I need this property "TableName" at all

          You don't.

          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