I'm playing around with vspackages. For now I'm asking how I can implement some kind of a data storage.
Is there a visual studio internal database or somthing which commonly does this?
I just need it to store some data not much but enough for using very simple small database. Maybe a xml file as storage is a posibility ?
Aside from XML which I believe would be a good choice, you can store some data, such as string values and images, in the Properties section of your Visual Studio project.
Double click on Properties from the Solution Explorer and go to the Resources tab. You can then store data in your Resources file (or you'll be given the option to create one first if it does not exist already)
Related
I am new to visual studio.
I made an app using excel vba that converts words into code 128 and display them.
I tried to recreate it, with visual studio, but I have no idea how to create a file that store data.
For example, the barcode code 128 table should be accessible through code to convert a simple text into a barcode view.
I know so far how to create service based database on sql, add column, and rows, but I need to know how to have (or create) a file with stored data to work with (like in excel, you create a sheet filled with data, and then, you can adress it using vba)
You've a really good tutorial's on the internet who helps you building a local database on visual studio.
I'll give you a initial steps to build one:
1st: After you create your project, Go to Project > Add New Item > And Choose Service-based Database
2nd: Open your database located on Solution Explorer with the name: nameyouchoose.mdf
3rd: It will open a DataSource on the Server Explorer where you can add your tables, records, etc...
Good tutorials:
docs
devu.com
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
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
I am building an application that is quite dynamic in nature (a lot of metadata coming from a database for example) and I want to store application parameters in a separate file. An example of a parameter is the column width of a certain column in a view.
I was thinking of creating a Resources file, but they can only store strings. Settings is not an option, because what I want to store are application parameters, not user settings.
What could be a good approach?
if your application dynamically stores data and its huge then better way to sore it is Database table.
if user dependent application setting data then you can use,
External file(ex. MS EXCEL...)
Configuration file of application.
Thank You!
You can use Serialization to store the parameter into registry.
Example:
You pass the String into Byte and serialize it.
When you are deserialize the information, you change the byte back to a string.
More you can find here..
Save serializable object to registry in .net?
Maybe its an opportunity for you..
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.