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. Web Development
  3. ASP.NET
  4. retreiving data from databse to web page

retreiving data from databse to web page

Scheduled Pinned Locked Moved ASP.NET
sysadmin
5 Posts 3 Posters 1 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.
  • K Offline
    K Offline
    Kunal P
    wrote on last edited by
    #1

    hi i wanted to ask that how can we retreive the values from a databse and write them on to the web form i used the code below to just retreive one column, though the browser gave me a errr. it stated that message recieved from server could not be parsed.. exception.. and that too when i had exception handling in place.. while (dread.Read()) { Response.Write(dread["Firstname"]); } any ideas..

    Kunal

    N 1 Reply Last reply
    0
    • K Kunal P

      hi i wanted to ask that how can we retreive the values from a databse and write them on to the web form i used the code below to just retreive one column, though the browser gave me a errr. it stated that message recieved from server could not be parsed.. exception.. and that too when i had exception handling in place.. while (dread.Read()) { Response.Write(dread["Firstname"]); } any ideas..

      Kunal

      N Offline
      N Offline
      Naveed Kamboh
      wrote on last edited by
      #2

      first check if you are getting data in dread i.e datareader then cast to string Response.Write(dread["Firstname"].ToString());

      Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam

      K 1 Reply Last reply
      0
      • N Naveed Kamboh

        first check if you are getting data in dread i.e datareader then cast to string Response.Write(dread["Firstname"].ToString());

        Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam

        K Offline
        K Offline
        Kunal P
        wrote on last edited by
        #3

        i did try that and also checked with Console.Write(dread[0]) but when i tried with console... nuthing got printed.. though.. no error came.. also now how do i check whether dread has a value.. when i debugged.. it does follow the loop... though the VIsibleFiledCOUnt = 12 i guess that means it has data..

        Kunal

        S 1 Reply Last reply
        0
        • K Kunal P

          i did try that and also checked with Console.Write(dread[0]) but when i tried with console... nuthing got printed.. though.. no error came.. also now how do i check whether dread has a value.. when i debugged.. it does follow the loop... though the VIsibleFiledCOUnt = 12 i guess that means it has data..

          Kunal

          S Offline
          S Offline
          Sathesh Sakthivel
          wrote on last edited by
          #4

          Hey did u try by putting Break Points in your code.

          Regards, Satips.

          K 1 Reply Last reply
          0
          • S Sathesh Sakthivel

            Hey did u try by putting Break Points in your code.

            Regards, Satips.

            K Offline
            K Offline
            Kunal P
            wrote on last edited by
            #5

            Satips wrote:

            Hey did u try by putting Break Points in your code.

            yeah!! thats how i performed my debugging... and got those values..

            Kunal

            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