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. WindowsApp and Website Share One Database

WindowsApp and Website Share One Database

Scheduled Pinned Locked Moved C#
csharpasp-netdatabasesysadminquestion
4 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.
  • A Offline
    A Offline
    ali_heidari_
    wrote on last edited by
    #1

    Hey. I made a website and a windows application which use one database. windows application duty is to register,editing,reporting data to database and website is just a static web application to show data! well i need some council to decide how i share database between them! Is better to keep database on a host and windows app connect it with IP server adress in connectionstring? or i should use webservie? Which one is more safe? Which one is more flexible? Is there another way? What if internet connection lost and windowss app is trying to register some data?(some data will be lost):confused: I decide to store data into a local database and a timer will update main database on the host every 10 minutes!Is it good? Is there better way? :^) (C#, ASP.NET,SQLSERVER) thank you !

    L S 2 Replies Last reply
    0
    • A ali_heidari_

      Hey. I made a website and a windows application which use one database. windows application duty is to register,editing,reporting data to database and website is just a static web application to show data! well i need some council to decide how i share database between them! Is better to keep database on a host and windows app connect it with IP server adress in connectionstring? or i should use webservie? Which one is more safe? Which one is more flexible? Is there another way? What if internet connection lost and windowss app is trying to register some data?(some data will be lost):confused: I decide to store data into a local database and a timer will update main database on the host every 10 minutes!Is it good? Is there better way? :^) (C#, ASP.NET,SQLSERVER) thank you !

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      source.compiler wrote:

      Which one is more safe?

      The webservice might be better in identifying brute-force attempts.

      source.compiler wrote:

      Which one is more flexible?

      A webservice, since it's custom code.

      source.compiler wrote:

      Is there another way?

      Write your own server and protocol. Doesn't offer much additional benefits though.

      source.compiler wrote:

      What if internet connection lost and windowss app is trying to register some data?(some data will be lost)

      It could be, depends on what you do with it.

      source.compiler wrote:

      I decide to store data into a local database and a timer will update main database on the host every 10 minutes!Is it good? Is there better way? :^)

      Ditch the timer. Simply write everything to the remote PC and a local copy/cache, and do a "merge" as soon as the user is online again.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      A 1 Reply Last reply
      0
      • A ali_heidari_

        Hey. I made a website and a windows application which use one database. windows application duty is to register,editing,reporting data to database and website is just a static web application to show data! well i need some council to decide how i share database between them! Is better to keep database on a host and windows app connect it with IP server adress in connectionstring? or i should use webservie? Which one is more safe? Which one is more flexible? Is there another way? What if internet connection lost and windowss app is trying to register some data?(some data will be lost):confused: I decide to store data into a local database and a timer will update main database on the host every 10 minutes!Is it good? Is there better way? :^) (C#, ASP.NET,SQLSERVER) thank you !

        S Offline
        S Offline
        SaqibRasheed
        wrote on last edited by
        #3

        Web-service approach will be more safe, and flexible; so, I don't think you should think about any other option when there are web-services. That is good thing that you are keeping such issues (like internet connection lost) in mind while working on your application. A better way could be to do a proper exception handling while connecting to the web-service as well as while calling methods of the web-service. If you are not connected, or some of the method has not returned the expected results this means something wrong happened. In that case you should keep backup of that record only and try re-inserting that record into the database laters. This entirely depends upon how much critical is that data for you with respect to usage point of view. You can try it re-inserting every 10 minutes of may be once in a day. But don't forget to remove the backup of that record once it is inserted into live database (For backup, you can use the same copy of database locally)

        1 Reply Last reply
        0
        • L Lost User

          source.compiler wrote:

          Which one is more safe?

          The webservice might be better in identifying brute-force attempts.

          source.compiler wrote:

          Which one is more flexible?

          A webservice, since it's custom code.

          source.compiler wrote:

          Is there another way?

          Write your own server and protocol. Doesn't offer much additional benefits though.

          source.compiler wrote:

          What if internet connection lost and windowss app is trying to register some data?(some data will be lost)

          It could be, depends on what you do with it.

          source.compiler wrote:

          I decide to store data into a local database and a timer will update main database on the host every 10 minutes!Is it good? Is there better way? :^)

          Ditch the timer. Simply write everything to the remote PC and a local copy/cache, and do a "merge" as soon as the user is online again.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          A Offline
          A Offline
          ali_heidari_
          wrote on last edited by
          #4

          Eddy Vluggen wrote:

          Ditch the timer. Simply write everything to the remote PC and a local copy/cache, and do a "merge" as soon as the user is online again.

          If i store a copy of updated database into a dataset,then does not it use memory much?or it needs to have a local database on hard? Thank you!

          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