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. cross query

cross query

Scheduled Pinned Locked Moved ASP.NET
csharpdatabaseasp-nettutorial
8 Posts 5 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
    C Coudou
    wrote on last edited by
    #1

    mates, how to come up with tblTemp using programming not sql. or any ideas how to get with tblTemp.

    tblItem {ORIGINAL TABLE}

    CDATE ITEMCODE ITEMVALUE
    2008-12-08 1001 4.5
    2008-12-08 1002 7.3
    2008-12-08 1003 0.5

    2009-03-25 1001 1.2
    2009-03-25 1002 0.3
    2009-03-25 1003 3.4

    tblTemp {I WANT THE RESULT LIKE THIS!}

    CDATE 1001 1002 1003
    2008-12-08 4.5 7.3 0.5
    2009-03-25 1.2 0.3 3.4

    in access i just use looping with ds.Fields.count - 1 (where ds is Recordset) but how will i do it in asp.net using Dataset not Recordset or something. ( I dont want to use recordset)

    C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

    G A 2 Replies Last reply
    0
    • C C Coudou

      mates, how to come up with tblTemp using programming not sql. or any ideas how to get with tblTemp.

      tblItem {ORIGINAL TABLE}

      CDATE ITEMCODE ITEMVALUE
      2008-12-08 1001 4.5
      2008-12-08 1002 7.3
      2008-12-08 1003 0.5

      2009-03-25 1001 1.2
      2009-03-25 1002 0.3
      2009-03-25 1003 3.4

      tblTemp {I WANT THE RESULT LIKE THIS!}

      CDATE 1001 1002 1003
      2008-12-08 4.5 7.3 0.5
      2009-03-25 1.2 0.3 3.4

      in access i just use looping with ds.Fields.count - 1 (where ds is Recordset) but how will i do it in asp.net using Dataset not Recordset or something. ( I dont want to use recordset)

      C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

      G Offline
      G Offline
      GlobX
      wrote on last edited by
      #2

      C#Coudou wrote:

      any ideas how to get with tblTemp

      You could try taking him/her to a movie, maybe dinner... see where it goes from there? ;P Seriously, though, I really don't understand your question. Why do you want to do it this way? Why don't you want to use SQL? SQL is infinitely better for querying data - that's what it does. Please explain further?

      C L 2 Replies Last reply
      0
      • G GlobX

        C#Coudou wrote:

        any ideas how to get with tblTemp

        You could try taking him/her to a movie, maybe dinner... see where it goes from there? ;P Seriously, though, I really don't understand your question. Why do you want to do it this way? Why don't you want to use SQL? SQL is infinitely better for querying data - that's what it does. Please explain further?

        C Offline
        C Offline
        C Coudou
        wrote on last edited by
        #3

        GlobX wrote:

        Why don't you want to use SQL?

        because i want to put in datatable as temptable not in sql, period. and from datatable to gridview. the problem is how will put in datatable.that is the question.

        C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

        G 1 Reply Last reply
        0
        • C C Coudou

          GlobX wrote:

          Why don't you want to use SQL?

          because i want to put in datatable as temptable not in sql, period. and from datatable to gridview. the problem is how will put in datatable.that is the question.

          C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

          G Offline
          G Offline
          GlobX
          wrote on last edited by
          #4

          Sorry, I still don't understand. I will leave this to someone else. Apologies.

          C 1 Reply Last reply
          0
          • G GlobX

            Sorry, I still don't understand. I will leave this to someone else. Apologies.

            C Offline
            C Offline
            C Coudou
            wrote on last edited by
            #5

            ooppss. sorry. PROBLEM SOLVED. JUST IN TIME. thanks anyway.

            C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

            T 1 Reply Last reply
            0
            • C C Coudou

              ooppss. sorry. PROBLEM SOLVED. JUST IN TIME. thanks anyway.

              C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

              T Offline
              T Offline
              thatraja
              wrote on last edited by
              #6

              C#Coudou wrote:

              PROBLEM SOLVED. JUST IN TIME. thanks anyway.

              Anyway it's better you close this question by posting the solution which you have find(Also clear the question too). Cheers.

              thatraja


              **My Tip/Tricks
              My Dad had a Heart Attack on this day so don't...
              **

              1 Reply Last reply
              0
              • C C Coudou

                mates, how to come up with tblTemp using programming not sql. or any ideas how to get with tblTemp.

                tblItem {ORIGINAL TABLE}

                CDATE ITEMCODE ITEMVALUE
                2008-12-08 1001 4.5
                2008-12-08 1002 7.3
                2008-12-08 1003 0.5

                2009-03-25 1001 1.2
                2009-03-25 1002 0.3
                2009-03-25 1003 3.4

                tblTemp {I WANT THE RESULT LIKE THIS!}

                CDATE 1001 1002 1003
                2008-12-08 4.5 7.3 0.5
                2009-03-25 1.2 0.3 3.4

                in access i just use looping with ds.Fields.count - 1 (where ds is Recordset) but how will i do it in asp.net using Dataset not Recordset or something. ( I dont want to use recordset)

                C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

                A Offline
                A Offline
                Anurag Gandhi
                wrote on last edited by
                #7

                Hi, This is called Pivoting of Data. Please have a look over my article: Pivoting DataTable Simplified[^] This can get you a flexible and customized result with a clean code.

                Anurag Gandhi.
                http://www.gandhisoft.com
                Life is a computer program and every one is the programmer of his own life.
                My latest article: Group GridView Data

                1 Reply Last reply
                0
                • G GlobX

                  C#Coudou wrote:

                  any ideas how to get with tblTemp

                  You could try taking him/her to a movie, maybe dinner... see where it goes from there? ;P Seriously, though, I really don't understand your question. Why do you want to do it this way? Why don't you want to use SQL? SQL is infinitely better for querying data - that's what it does. Please explain further?

                  L Offline
                  L Offline
                  Lisa Z Morgan
                  wrote on last edited by
                  #8

                  You can create a datatable entirely in code, add the columns to it, and populate it, then just use it as if you had loaded it from a database. Are you using C# or VB? I'll post a sample when I know which language you like. Lisa Z. Morgan

                  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