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. syntax

syntax

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorialquestion
11 Posts 4 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.
  • R Offline
    R Offline
    R Thomas 0
    wrote on last edited by
    #1

    hi... when using reader in ASP.NET using VB.NET..this is how i get ALL the data While reader.Read() 'do stuff here... End While can u pls tell me the SYNTAX of how to do the above same thing if i am using dataset??? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

    G N 2 Replies Last reply
    0
    • R R Thomas 0

      hi... when using reader in ASP.NET using VB.NET..this is how i get ALL the data While reader.Read() 'do stuff here... End While can u pls tell me the SYNTAX of how to do the above same thing if i am using dataset??? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

      G Offline
      G Offline
      Gerald Leslie Jones
      wrote on last edited by
      #2

      Adapter ad = new Adapter(); DataSet ds = new DataSet(); ad.Fill(ds); int count = ds.Tables[0].Rows.Count; for(int iLoop = 0; i < count; ++i) { Response.Write(ds.Tabls[0].Rows[i]["ColumnName"].ToString()); } Here, instead of ColumnName you can give the ColumnIndex also.

      1 Reply Last reply
      0
      • R R Thomas 0

        hi... when using reader in ASP.NET using VB.NET..this is how i get ALL the data While reader.Read() 'do stuff here... End While can u pls tell me the SYNTAX of how to do the above same thing if i am using dataset??? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        foreach( DataRow row in ds.Table[0].Rows )

        R 2 Replies Last reply
        0
        • N Not Active

          foreach( DataRow row in ds.Table[0].Rows )

          R Offline
          R Offline
          R Thomas 0
          wrote on last edited by
          #4

          I AM USING VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

          1 Reply Last reply
          0
          • N Not Active

            foreach( DataRow row in ds.Table[0].Rows )

            R Offline
            R Offline
            R Thomas 0
            wrote on last edited by
            #5

            datarow IS NOTA KEYWORD IN VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

            E N 2 Replies Last reply
            0
            • R R Thomas 0

              datarow IS NOTA KEYWORD IN VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

              E Offline
              E Offline
              Edbert P
              wrote on last edited by
              #6

              DataRow is a class name, not a keyword. You probably should try this: For Each row As DataRow In dataSet.dataTable.Rows    Insert code here Next Edbert P. Sydney, Australia.

              R 1 Reply Last reply
              0
              • E Edbert P

                DataRow is a class name, not a keyword. You probably should try this: For Each row As DataRow In dataSet.dataTable.Rows    Insert code here Next Edbert P. Sydney, Australia.

                R Offline
                R Offline
                R Thomas 0
                wrote on last edited by
                #7

                actually i am more concerned about using cols... For Each dr In ds.Tables("default").Rows i = -1 For colCounter = 1 To ds.Tables("default").Columns.Count i = i + 1 If IsDBNull(ds.Tables("default").Rows(rowCounter)(ds.Tables("default").Columns(i))) Then columnData = " - " Else columnData = dr.Item(i) End If Next is ter eany way i can stop using (i) in the above code??? tks a lot.... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

                E 1 Reply Last reply
                0
                • R R Thomas 0

                  datarow IS NOTA KEYWORD IN VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

                  N Offline
                  N Offline
                  Not Active
                  wrote on last edited by
                  #8

                  No need to shout, just read the docs. But then if you wanted to read you'd be learning C# :):laugh:

                  R 1 Reply Last reply
                  0
                  • N Not Active

                    No need to shout, just read the docs. But then if you wanted to read you'd be learning C# :):laugh:

                    R Offline
                    R Offline
                    R Thomas 0
                    wrote on last edited by
                    #9

                    :wtf: "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

                    1 Reply Last reply
                    0
                    • R R Thomas 0

                      actually i am more concerned about using cols... For Each dr In ds.Tables("default").Rows i = -1 For colCounter = 1 To ds.Tables("default").Columns.Count i = i + 1 If IsDBNull(ds.Tables("default").Rows(rowCounter)(ds.Tables("default").Columns(i))) Then columnData = " - " Else columnData = dr.Item(i) End If Next is ter eany way i can stop using (i) in the above code??? tks a lot.... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

                      E Offline
                      E Offline
                      Edbert P
                      wrote on last edited by
                      #10

                      You can do it in at least two different ways: 1. Iterate through rows and then columns For Each dr As DataRow In ds.Tables("default").Rows      For Each dc As DataColumn In ds.Tables("default").Columns           If IsDBNull(dr(dc)) Then                columnData = " - "           Else                columnData = dr(dc)           End If      Next dc Next dr 2. Iterate through rows and the items For Each dr As DataRow In ds.Tables("default").Rows      For Each obj As Object In dr.ItemArray           If IsDBNull(obj) Then                columnData = " - "           Else                columnData = obj           End If      Next dc Next dr Read the documentation on MSDN for more examples and explanation about this. I hope it helps :) Edbert P. Sydney, Australia.

                      R 1 Reply Last reply
                      0
                      • E Edbert P

                        You can do it in at least two different ways: 1. Iterate through rows and then columns For Each dr As DataRow In ds.Tables("default").Rows      For Each dc As DataColumn In ds.Tables("default").Columns           If IsDBNull(dr(dc)) Then                columnData = " - "           Else                columnData = dr(dc)           End If      Next dc Next dr 2. Iterate through rows and the items For Each dr As DataRow In ds.Tables("default").Rows      For Each obj As Object In dr.ItemArray           If IsDBNull(obj) Then                columnData = " - "           Else                columnData = obj           End If      Next dc Next dr Read the documentation on MSDN for more examples and explanation about this. I hope it helps :) Edbert P. Sydney, Australia.

                        R Offline
                        R Offline
                        R Thomas 0
                        wrote on last edited by
                        #11

                        tks buddy.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

                        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