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. To display data of multiple tables

To display data of multiple tables

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorialquestion
4 Posts 4 Posters 2 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
    User 11127370
    wrote on last edited by
    #1

    HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...

    Kornfeld Eliyahu PeterK S D 3 Replies Last reply
    0
    • U User 11127370

      HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      It's unclear... Do you want to display some unrelated data from several tables in one grid? I think it's impossible... If it is complementary data from different tables use JOIN in the SQL... If this is some hierarchical data you may see this article: http://msdn.microsoft.com/en-us/magazine/cc164077.aspx[^]

      I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V) תפסיק לספר לה' כמה הצרות שלך גדולות, תספר לצרות שלך כמה ה' גדול!

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      1 Reply Last reply
      0
      • U User 11127370

        HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...

        S Offline
        S Offline
        Shweta N Mishra
        wrote on last edited by
        #3

        Create a stored procedure and get the data from multiple tables as per their relation in one result set and display them in grid view.

        1 Reply Last reply
        0
        • U User 11127370

          HI, Every one As i am new in asp.net,so i don't know how to display data of multiple tables in single GridView. Can any one help? Thanks in ADVANCE...

          D Offline
          D Offline
          Dusara Maulik
          wrote on last edited by
          #4

          If these two tables are similar, you can use a UNION[^] clause. If they have a foreign key relationship, you could join[^] the two tables and then display them together. Or

          DataRelation dr = new DataRelation("Relation", ds.SomeTable.Columns["code"], ds.OtherTable.Columns["pCode"]);
          gView.DataSource = ds.SomeTable;

          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