I have developed a Windows application in c# in which multiple users can add some numbers and their name and can view the data entered. The problem that I have is that the sever is on my laptop and every time I log off or close my laptop, they are losing connection to the DB and can not add or view any more.
It seems that the port is closed or something. Is there a way to keep the port and their connection established all the time even when I’m logging out?
5
Very probably, the SQL database engine is running from your own local account; when you log off, all the processes running from this account are stopped, including the database engine.
Instead, the database engine should be run using either Local Service or Network Service account, or a dedicated account which will never be logged off. Those accounts are for example used by many Windows Services, which allow them to remain active when there are no active users, and do some tasks on the background, like defragmenting the disks.
This being said and other people have pointed it out, you shouldn’t run a database used by other people on your laptop, but use a server instead.
Even if you have a very basic needs (no SLA needed, frequent downtime is acceptable, data loss acceptable, etc.) and don’t need real server-level infrastructure with redundancy, backup power, etc., running a database used by several people is rather strange. If you don’t need anything provided by real server hardware and infrastructure, then at least build a basic, inexpensive PC that will be always on.