Local Application to Save C#Data

Asked

Viewed 658 times

0

I’m in need of working with Windows Forms, more specifically in a system that works on intranet, without the possibility of using MYSQL, SQL Server among others.

I need to create a second project that serves as a server and save the data only on that machine that is running, through files. I have no idea how to do this and I need help knowing what to use in this situation.

  • Not even Sqlite, which is just a . dll? Because if it’s not even that, then your only output is text file(whether plain text, CSV, XML or JSON) or binary file.

  • Not even Sqlite, unfortunately, otherwise it is not possible because I need to send the information to the server, to save only on the host machine.

  • @Bruno, Sqlite does not need to be installed or has other functions, the only requirement is that you have permission to write, so if you can not use it, then you can not use files of any nature, be it TXT, CSV, etc... in this case could only store in memory, and in this case the data will not persist for long.

  • @Tobymosque And how to use Sqlite by storing the data on a single network machine?

  • 1

    As you can see, the Connectionstring of Sqlite accepts the physical path of the *.db file as Data Source... In any case, I do not advise using a compatible file to make the persistence... In this case it is best to install MSSQL Express or Postgresql.

  • @Tobymosque, as I said before, I cannot use these solutions. Has a system, called Nex, which is a Box system, it installs the Nex Server where it allows to store all the data of the system, my idea was to create something similar, but I do not know what to do this.

  • Nex Server has a database, so much so that there is the option to repair the same... Correcting the Database

Show 2 more comments

1 answer

0

by your comment, you are confused not having a database with having an embedded database.

for example, you can create an installer with Installshield who installs the SQL Server Express Localdb (MSI installer) in the machine.

Using Entity Framework Code First with Migrations, you will be able to create or update the database structure.

Finally, you can develop a service WCF and host the same in a Windows Service using TCP (netTcpBinding), Installshield is also able to install and configure the Service.

And your Clients of this application will basically install a dumb terminal that just connects to the Server through a WCF Service.

Note that although we are installing a SGBD, creating/updating the data flock, installing and configuring a service, all this is chained in a Simple Installer (a.k.a Next > Next > Next). The same goes for Terminals. then you will have two installers (MeuSistemaCliente.exe and MeuSistemaServidor.exe)

Just one last point, if you really want to make the persistence of the data in a compatible text file on the network, be a *.txt, *.csv... or even something more refined as a *.db(Sqlite), know that you will have to deal with competitive issues and the constant risk of having your file corrupted and/or system crash due to some lock in the archive.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.