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. Connect to the database with Ajax via Asp.net

Connect to the database with Ajax via Asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelpquestion
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.
  • M Offline
    M Offline
    Morgs Morgan
    wrote on last edited by
    #1

    hey guys, I'm not good with Ajax, I am trying to connect to the database using ajax through asp.net. does anyone know how I can do this? please help :doh: Thanks guys

    B S M 3 Replies Last reply
    0
    • M Morgs Morgan

      hey guys, I'm not good with Ajax, I am trying to connect to the database using ajax through asp.net. does anyone know how I can do this? please help :doh: Thanks guys

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      MorgSim wrote:

      I'm not good with Ajax, I am trying to connect to the database using ajax through asp.net.

      What do you mean by connecting DB through Ajax.Ajax is way to postback the page partially.So when you are at server side, you can can connect the DB as normally you do. Do you mean something else?

      Cheers!! Brij

      M 1 Reply Last reply
      0
      • B Brij

        MorgSim wrote:

        I'm not good with Ajax, I am trying to connect to the database using ajax through asp.net.

        What do you mean by connecting DB through Ajax.Ajax is way to postback the page partially.So when you are at server side, you can can connect the DB as normally you do. Do you mean something else?

        Cheers!! Brij

        M Offline
        M Offline
        Morgs Morgan
        wrote on last edited by
        #3

        ok thanks, for instance, I want a user to enter a userid and upon doing that I want to connect to the database in the background to check if the id exist, if so, I will then insert the username for the user. The whole problem is connecting to the database as the user types which is why I think ajax would do the trick here even though am not sure how to implement this. Would you have any help please? Thanks,

        B 1 Reply Last reply
        0
        • M Morgs Morgan

          hey guys, I'm not good with Ajax, I am trying to connect to the database using ajax through asp.net. does anyone know how I can do this? please help :doh: Thanks guys

          S Offline
          S Offline
          Sandeep Mewara
          wrote on last edited by
          #4

          Best would be to use XMLHttpRequest(old times AJAX! :) ) in order to implement such kind of feature... On keypress, fire a XHR and check on server about the typed in data(connecting to database) and get back response accordingly. if you need to know about it, just google it, you will get number of articles on it!

          A 1 Reply Last reply
          0
          • M Morgs Morgan

            ok thanks, for instance, I want a user to enter a userid and upon doing that I want to connect to the database in the background to check if the id exist, if so, I will then insert the username for the user. The whole problem is connecting to the database as the user types which is why I think ajax would do the trick here even though am not sure how to implement this. Would you have any help please? Thanks,

            B Offline
            B Offline
            Brij
            wrote on last edited by
            #5

            For that you ealier verion of Ajax ie XMLHTTPRequest objects.You can get a lot on this in Codeproject itself. Have a look to a sample Click Here You can also use callback. There is a control provided in Ajaxtookit.Its very simple to use and might suffice your requirement. AutoComplete[^]

            Cheers!! Brij

            M 1 Reply Last reply
            0
            • B Brij

              For that you ealier verion of Ajax ie XMLHTTPRequest objects.You can get a lot on this in Codeproject itself. Have a look to a sample Click Here You can also use callback. There is a control provided in Ajaxtookit.Its very simple to use and might suffice your requirement. AutoComplete[^]

              Cheers!! Brij

              M Offline
              M Offline
              Morgs Morgan
              wrote on last edited by
              #6

              Thanks alot, I will try it hope it works!

              1 Reply Last reply
              0
              • M Morgs Morgan

                hey guys, I'm not good with Ajax, I am trying to connect to the database using ajax through asp.net. does anyone know how I can do this? please help :doh: Thanks guys

                M Offline
                M Offline
                mrMercury
                wrote on last edited by
                #7

                You could use ASP.NET AJAX[^] to call a WebService or PageMethod from the client and then use JavaScript and the DOM to show the new data to the user, check this link[^] for samples and tutorials.

                1 Reply Last reply
                0
                • S Sandeep Mewara

                  Best would be to use XMLHttpRequest(old times AJAX! :) ) in order to implement such kind of feature... On keypress, fire a XHR and check on server about the typed in data(connecting to database) and get back response accordingly. if you need to know about it, just google it, you will get number of articles on it!

                  A Offline
                  A Offline
                  Abhijit Jana
                  wrote on last edited by
                  #8

                  I am not sure why this post was voted "1". I think this is the good answer, hence I upvoted it with my 5.

                  Cheers ! Abhijit Codeproject MVP

                  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