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. General Programming
  3. C#
  4. How can my hosted asp.net website access my local machine database

How can my hosted asp.net website access my local machine database

Scheduled Pinned Locked Moved C#
csharpasp-netdatabasehelpquestion
11 Posts 3 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.
  • A Offline
    A Offline
    akosidandan
    wrote on last edited by
    #1

    Hello experts, I have a asp.net website with c# as behind file code and also a win form app. I would like to ask, how can my asp.net website get the database records of my win form app in my local machine? I'm able to receive the database records coming from my website to my win form app here at my local machine using web service but sending my database records to my website is confusing me. Any help is kindly appreciated. Thanks, DAN

    L E 2 Replies Last reply
    0
    • A akosidandan

      Hello experts, I have a asp.net website with c# as behind file code and also a win form app. I would like to ask, how can my asp.net website get the database records of my win form app in my local machine? I'm able to receive the database records coming from my website to my win form app here at my local machine using web service but sending my database records to my website is confusing me. Any help is kindly appreciated. Thanks, DAN

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      one normally stores the database and the web site on the same machine (or machine cluster). That is why the typical web host will offer PHP+MySQL facilities, or ASP.NET+SQLServer, or whatever combination makes sense to the market. :)

      Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

      A 1 Reply Last reply
      0
      • L Luc Pattyn

        one normally stores the database and the web site on the same machine (or machine cluster). That is why the typical web host will offer PHP+MySQL facilities, or ASP.NET+SQLServer, or whatever combination makes sense to the market. :)

        Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

        A Offline
        A Offline
        akosidandan
        wrote on last edited by
        #3

        Hello, Thanks for the reply. Seems my last resort is to really host my own website to my local machine.

        L 1 Reply Last reply
        0
        • A akosidandan

          Hello, Thanks for the reply. Seems my last resort is to really host my own website to my local machine.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          I trust there are ways to keep site and database apart, however I see lots of disadvantages. Why can't you have a database where your site is? If that really is the case, I would consider switching web hosts. Having your own host is a pain, you need to provide hardware and software, have a fixed IP address and sufficient bandwidth, probably organize redundancy for reliability, organize backups, maybe a help desk, etc. There are thousands of web hosts all around the world, and a lot of them are free. Use Google to find out, this[^] is just one I stumbled upon. BTW: you probably are best served by a host you pay for the service. My site is hosted here[^], for some 80 euro a year. :)

          Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

          A 1 Reply Last reply
          0
          • A akosidandan

            Hello experts, I have a asp.net website with c# as behind file code and also a win form app. I would like to ask, how can my asp.net website get the database records of my win form app in my local machine? I'm able to receive the database records coming from my website to my win form app here at my local machine using web service but sending my database records to my website is confusing me. Any help is kindly appreciated. Thanks, DAN

            E Offline
            E Offline
            Expert Coming
            wrote on last edited by
            #5

            It is actually entirely possible to do what you are trying to do. Most large companies do not host the database and the web server on the same physical server. It is best practice to have them at the same location so they can be on the fastest possible network however. First make sure you have a static IP Address where you wish to host your SQL server (you can also look at a dynamic IP solution more complex though) Open the port for your chosen SQL software Have you web service connect to the SQL server using the static IP Address from above. I have done this before, several times, and results vary. You almost always want a very fast connection to your database, usually on the same LAN, sometimes it doesn't matter. You'll find out pretty quick.

            The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

            A 1 Reply Last reply
            0
            • L Luc Pattyn

              I trust there are ways to keep site and database apart, however I see lots of disadvantages. Why can't you have a database where your site is? If that really is the case, I would consider switching web hosts. Having your own host is a pain, you need to provide hardware and software, have a fixed IP address and sufficient bandwidth, probably organize redundancy for reliability, organize backups, maybe a help desk, etc. There are thousands of web hosts all around the world, and a lot of them are free. Use Google to find out, this[^] is just one I stumbled upon. BTW: you probably are best served by a host you pay for the service. My site is hosted here[^], for some 80 euro a year. :)

              Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

              A Offline
              A Offline
              akosidandan
              wrote on last edited by
              #6

              Hello, My reason to connect my website to my local database is to sync the two database from my local machine database and the database I upload also from the site. I can get some database records coming from my website and use the records to update my back end program using web service of asp but a big problem came that my back end program could not sent its database records to my website :( By the way my website was a simple online registration for school and the back end program is the offline part its a school project of mine and kinda cramming because few months left before the deadline. Thanks also for the link on the free hosting site I might give it a try. Thanks, DAN

              L 1 Reply Last reply
              0
              • E Expert Coming

                It is actually entirely possible to do what you are trying to do. Most large companies do not host the database and the web server on the same physical server. It is best practice to have them at the same location so they can be on the fastest possible network however. First make sure you have a static IP Address where you wish to host your SQL server (you can also look at a dynamic IP solution more complex though) Open the port for your chosen SQL software Have you web service connect to the SQL server using the static IP Address from above. I have done this before, several times, and results vary. You almost always want a very fast connection to your database, usually on the same LAN, sometimes it doesn't matter. You'll find out pretty quick.

                The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                A Offline
                A Offline
                akosidandan
                wrote on last edited by
                #7

                Hello, Thanks for the great info. Would you mine if you could give me some a little help or info on how can my asp.net web service connect to the static IP where my SQL server is located. Kinda Google it almost everyday but still don't find some way on how to do it. Thanks, DAN

                1 Reply Last reply
                0
                • A akosidandan

                  Hello, My reason to connect my website to my local database is to sync the two database from my local machine database and the database I upload also from the site. I can get some database records coming from my website and use the records to update my back end program using web service of asp but a big problem came that my back end program could not sent its database records to my website :( By the way my website was a simple online registration for school and the back end program is the offline part its a school project of mine and kinda cramming because few months left before the deadline. Thanks also for the link on the free hosting site I might give it a try. Thanks, DAN

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  OK, you want a remote backup. This is what I do manually: - I have a local database on my dev machine, and a similar one at ny web host; - I transfer tables (never the entire DB), from one to the other using PHPMyAdmin; "export" creates a text file, filled with SQL commands that could delete and recreate an entire table; "import" would execute such file, hence dropping the existing and creating the replacement table. Of course there could be very good reasons to automate this. Haven't done that yet. :)

                  Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

                  Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

                  A 1 Reply Last reply
                  0
                  • L Luc Pattyn

                    OK, you want a remote backup. This is what I do manually: - I have a local database on my dev machine, and a similar one at ny web host; - I transfer tables (never the entire DB), from one to the other using PHPMyAdmin; "export" creates a text file, filled with SQL commands that could delete and recreate an entire table; "import" would execute such file, hence dropping the existing and creating the replacement table. Of course there could be very good reasons to automate this. Haven't done that yet. :)

                    Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

                    Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

                    A Offline
                    A Offline
                    akosidandan
                    wrote on last edited by
                    #9

                    Hello, Thanks again for that great help, would you mine if you could show how will I do that using asp Thanks again, DAN

                    L 1 Reply Last reply
                    0
                    • A akosidandan

                      Hello, Thanks again for that great help, would you mine if you could show how will I do that using asp Thanks again, DAN

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #10

                      Sorry, I don't know for ASP and SQLServer, I do it with PHPMyAdmin which is for PHP+MySQL. :)

                      Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

                      Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

                      A 1 Reply Last reply
                      0
                      • L Luc Pattyn

                        Sorry, I don't know for ASP and SQLServer, I do it with PHPMyAdmin which is for PHP+MySQL. :)

                        Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

                        Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

                        A Offline
                        A Offline
                        akosidandan
                        wrote on last edited by
                        #11

                        Hello, Thanks still for the great idea. I will try and hope I can do it with asp using the idea you give me. :) Thanks, DAN

                        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