Windows Application or web application for this purpose - c#

I have about 5000 csv file and I want to insert them in a sql server 2008 database.
I don't whether windows application or web application is better.
each csv file is simple a one row with 36 column that will be inserted in an one table in the database.
thanks for your help.
Update 1
This application will be used on a computer that can connect to the database, it is used by the admin just once, in order words, there are people who responsible to write these csv files, then all the files, come to me and I have to insert them in the database
Update 2
Thanks for the user who are trying to help me.
You gave me these options:
bcp
SqlBulkCopy
Windows service
what is the best please? I told you all the requirements, which are very simple.

Depends how you want to use it - if you want to deploy to lots of people so they can upload a file and process it into a database, make it web.
If on the other hand, you only have a couple of users which you can easily deploy an app to, there is a lot less infrastructure required to write it as an app.
Sounds to me, you want to automate the mass loading of lots of files, so windows app is jumping out at me.
All depends on what the overall requirements are.
Based on your edit, write a win app that uses a folder enumeration, reads the records and passes to a SqlBulkCopy object.

based on your comment I would take an aproach like that:
Easy to use gui solution:
1. Make a website for people that are making the csv's
That website would preform and check's that are necesery and display any errors. Error checking is done by the Web service (more future proven imo).
Create a webservice importing the file to database and sending you an email. That way you don't have any work with putting the data into the database
Implement an aproveal mechanism so you need to aprove the new inputs to the database if needed
Easy to implement solution:
Create an application (Console/WinForm/Web) that uses the bcp tool to import the data and handles errors

Related

I need to create an App which insert data from PDF forms to SQL base

I need to create a background app like a 'job' that runs everyday in a specific directory. This job have to pick up a bunch of PDF forms that have been filled (all those forms are purchase orders) and extract then insert those data into a purchase orders Microsoft SQL database.
I know that Excel as a pretty good import feature for this situation but I need it to be automatic and more like a "Service" which really runs in background.
I've been looking for ideas on how to approach the problem and I did not find much so, if you guys have any ideas I would love to hear about them.
Edit : I think a good solution would be a powershell script which does it all, loop, import, insert.
Thank you in advance.
You can use a C# Console Application for that. Write a console app that extracts data from Excel/PDF then writes it directly to MsSQL database. Then trigger it with Scheduled Tasks on windows.

Creation of a graphical interface to save and view historical logged data

Im working with a 3rd party system where lots of settings are saved. These are typically single numbers, but in some cases can take the form of 1D or 2D tables. Within this system there is no versioning, backup, or history for the settings. Once you change a number you cannot revert your change, or look back what the number was 2 weeks ago. I am creating something to handle this.
The data could be described like this:
Var_A = {1}
Var_B = {3.4}
Table_A = {2,4.5,3,10}
Table_B = {{2,5,7}{3,8,1}{2,65,106}}
I have a simple c# console app where I am able to pull data from this system via a websocket interface and can display data in real time in the console, or write to a simple .txt log file. With a seperate app I can also send values back to the 3rd party system.
What I would like to acheive:
Save all values from the 3rd party system on demand to some sort of log/database
View historical values - A simple interface where I can jump through time and look back at historical values. Veiwing each complete timestep is fine for a first step, but an ultimate aim would be to be able to drill down into the history of invividual values, and be able to search for when certain values changed.
Send values back to the 3rd party system - both individual values and the entire record from any given 'save' time
All of this should be easy to deploy on a series of windows PCs without lots of external dependancies
What I need help with:
What should I look at to save the values? At most there will be in the order of several hundred 'saves' of around 50 variables per deployment - Not high frequency data. Can I use something like an .xml file? do I need a database, and if so what should I be considering with a priority on lightweight and easy to deploy?
What librarys and projects are out there to get me started on the historical data gui? Im sure what im trying to acheive has parallels elsewhere and someone out there has already done a far better job of this than I will starting completely from scratch. Im open to all options at this stage - wpf/winforms, browser based, or other. Im most comfortable with C# and the .net world and my existing code to import and export data is C# but I'm open to picking up other options if theres a really good solution elsewhere I can leverage.

Mysql database alternatives if Mysql isn't an option

I'm working on an app using Unity. This app is supposed to upload certain simple information at specific points, which is why my original plan was to just connect it to a Mysql database. Unfortunately Unity doesn't support the NET 4.0 framework and nothing I've tried seems to work.
Yes I could use PHP scripts hosted on my web server to add and pull information, but I'd rather do it all from the app itself if at all possible.
The data I need to record is pretty simple, IDs, ints, strings, nothing too complex.
So I'm now trying to look into alternatives to Mysql.
JSON
So far I have gotten SFTP to work (By using the Renci.SshNet library) and the app is now uploading files in my server's home directory. So my original idea was to just create JSON files with the data and edit them remotely.
Is this something that could be done with C#? How? Any specific resources?
The alternative to remote editing would be to download the JSON file, edit it locally, and then upload it again, but that doesn't sound like a very smart idea.
I have found this answer but it's unclear to me if it requires to send the whole JSON file to the server after every edit or if it's possible to just edit it from the app. Some clarification would be great.
SQLlite
I've also looked into SQLlite but I'm also unsure if it could be remotely edited.
I've Googled it multiple times but can't really find any useful information.
What are my options at this point? What should I use if I needed the equivalent of a Mysql Database that can be remotely edited and read?
You can start seeing into Google Firebase project
https://firebase.google.com/docs/database/unity/start
But unity 2018.3 does support Net 4:
https://learn.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017
https://blogs.unity3d.com/es/2018/07/11/scripting-runtime-improvements-in-unity-2018-2/
https://blogs.unity3d.com/es/2018/03/28/updated-scripting-runtime-in-unity-2018-1-what-does-the-future-hold/

Using a local database

I'm busy writing a small app and I only want a database to load small amounts of data, in other words I don't need the functionality of SQL.
So I've installed filehelpers, but it seems very limited in the sense that I can read/write and even append data, but it seem impossible to delete one row of data in a table?
Does anyone know how to do this with filehelpers or point me to a different solution where I can just add a local db to my app without any other external software required?
PS. My visual studio does not have the "create local db" from the item selection.
For something like this, I'd use an embedded SQLite database. It gives you the best of both worlds, one file database for local data and most of the features of SQL.
See here: https://sqlite.org/
On their download page, they have lots of stuff and a plugin for VS:
https://sqlite.org/download.html

User-specific settings files for a windows form application: local xml file or database

My coworkers and I cannot seem to agree on a solution to the following issue:
We are working on moving our application to the .net framework. It will be a standalone application (not a web application) that will consist of many custom forms used for making changes to our extensive database. So, in summary, without a database connection, the application is pretty much useless. Oh--and there's no need to suggest making this a web application because there is really no choice in the matter.
I am responsible for building the "main menu"--I've decided on a tree structure that will list all the custom forms (categorized by team). It will also include a "My Forms" section and a "Recent Forms" section that will be changed by the user (my forms) and the system (recent forms) on a regular basis.
My question is this: what is the best place for storing these custom user-specific-settings? An XML file located locally or in tables located database? Maybe it's because I'm a former web app developer but I'm totally for having this stored on the database. What do y'all think?
Thanks for your opinions
If the user can function without the database they should be a local xml file. If the app requires the database to be functional, I'd add them to the database. Why add some new concept to the app, just keep storage of data in a single place. Your app will be able to run with lower privileges as well. If you're using the asp.net membership model (yes, for the desktop app) then you'll be able to take advantage of the profiling.
I vote database!
Another advantage of keeping them in the database is that when the user logs in to your application from another computer, all of their settings will be preserved. If they are stored on the local machine, moving to another machine would cause them to lose their settings.
It can be troublesome to mix user settings and user data in the same storage location.
This approach will basically double the number of times the database structure has to change.
If there is a bug in the settings code, there is a chance to corrupt/lose user data which is much more serious than corrupting/losing a user setting.
If the user wants to move or back up their data, the settings are also carried with it.
I would advise against keeping the settings in the database.

Categories

Resources