C# Winform save settings - c#

I am working on a project in C# Winforms and one of the requirements is to allow the user to save various settings versions and give a name for each of them. The idea is to have a form, the user press the button Save Setting, enter a string in the text box for the name for that setting. Later the user can select from a comboBox which settings to use. I already created a standard setting which saves automatically when the user closes the form. Can you please direct me on how to that?
EDIT:
The following forms demonstrate what I would like to achieve.
The user enter some data in the textBoxes (form Main), then save the details giving to this setting the name of setting01 (form Save setting). Then enter some other details and give the name of setting02.
Now the user can use setting01 or setting02, which contain different values for the same textBox.
Can please someone help me with this adventure?

Microsoft Developer Network has a nice tutorial on how to create a database and using it to store and retrieve data here
Hope it helps.
EDIT:
When the data is collected, do:
combobox1.items.add(data_that_was_collected);

Related

How to add text file for each new user created in database?

I have a program which enables me to create a new user. To add a new user the program asks for a username and a password. Picture below.
When the user types a username and a password, then clicks save, the username and the password is saved into a table which I have created through Visual Studio 2015, in a database which has also been created through this IDE.
I need, upon creation of a new user, for the program to create a new text file for that particular new user. Then when a user logs in using this window,
their own text file which was created should appear in a text box which they can add things to. Every time they log in, they view their own text file. This takes place in this window
The save button, saves any edits to the text file in question, and the load button should load the text file. Ideally, I would like to remove the load button and have the content of the text file shown straight into the text box.
I have tried to work around this by breaking it down to pieces. I know a .txt needs to be created upon saving a new user, but I don't know where to go from there. I'm hoping for a solution that will enable the program to work on any machine.
I have looked up on the internet about database user files, creating a new user with files etc and the only thing I found was a question on here and it turns out that a database isn't a good solution to store text files. I have checked MSDN, YouTube, on YouTube I found how to upload an image to a user in a database, but not a text file.
Can anybody help me on this? It doesn't have to be code in particular just the steps in general then I can gladly look things up.
You haven't indicated the type of sql databasse, I assume it for sql-server.
For small files you can use binary or varbinary as described here.
For really bigger files as your requirement here the documentation on BLOBs in SQL-Server

How to develop SmartList In C# like MSDynamic

How can i develop smartlist in C# .Is there any idea
*User Select Fields and make a graph After this he want to save the settings for future and this setting show as a smartlist whenever user click the graph formed .User dont want to enter the setting again and again

crystal report as website

Ok I am not sure the question I need to ask so I am going to describe what I would like to be able to do I am wondering if this is possible.
I have some paper forms that I am creating webpages for so that the information can be stored in the database using a computer. I have already created one and the user enters the information it is stored in the database then the user has the option to print a crystal report that looks like the paper form with the information entered.
Is it possible to cut out the middle man and have a crystal report as a webpage that the user can hit enter the information into the report and then hit a save control on the page to save it to the database and print from there.
If I am not asking the right question or you need more information please feel free to ask. If it is possible to design the report and then use that on the page make it editable to the client then that would make my life a whole lot easier I just dont know what to look up.
If what you need is to let user fill out a form and the data can save to database, and then the user can access the form, then there are several options:
Use Adobe forms. In this way, you can create pdf forms and you can let people download or email the forms. The forms are fillable, and when they submit the form, all you need is handle it(in forms of xml) at your server side to save it to your database. You could pre-populate data so that when the user download the file and open it, it has some data filled out. The tool you will need to create Adobe forms is Adobe LiveCycle and you have to learn how to use it. Our company use it for some of our web forms because they are secure and can be emailed. Of course you will need to implement server side code to handle it.
Use asp.net web form. You create web form and linked to database. You handle the form data user entered and save them to the database by using ado.net. That give you the most flexibilities.
If you want user open the form they entered in a specific format so that it will looks like a "form", you have two options:
<1> Pass your raw data to a specific css to let user print out in a nicer format instead of just plain text or even the web page. Again, you get flexibilities through this way.
<2> Use SQL Server Report Services(If you use sql server). In this way, you can create print layouts by using visual studio, and then write a stored procedure to get data. If you do this way, the user will also get a pdf file. They can save it or print it.
Hope this helps.
It is possible (assuming you are using a version of SQL which allows you to write stored procedures), but it's a very bad idea:
Write a SQL stored procedure, with a parameter for each field to be entered, that updates the relevant database tables with the appropriate parameter values.
Generate a Crystal report from the stored procedure.
Note that the only functionality available to the data entry fields (lookups, validation, etc.) will be that available to Crystal Report parameters in whichever version of Crystal you are using - generally, this functionailty is minimal.

Submitting a form programmatically [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How do you programmatically fill in a form and 'POST' a web page?
I've been looking for a way to allow a user to submit a form using C# or even HTML,so I get the source code, save it in a file and get the name of the text fields in order to submit the form.
for example logging with ur email to Facebook, gmail,stackoverflow ... or any page containing a form.
Before I ask how,is it possible?
My project is mainly to help visually impaired people surf the web easier! like get any html source code and be able to re-arrange the tags, omit images and such tags that won't benefit them,and try to give them the ability to log in using speech to text ...so my code will take the speech convert it to text field by field and submit the form when he/she's done! of course the name of the fields will be spoken using text to speech!
Thanks in advance
Have you looked at the WebBrowser control?
http://msdn.microsoft.com/en-us/library/aa752041(v=vs.85).aspx
It will allow you to automate surfing. You'll also be able to interact with the pages and modify values in text boxes, click buttons, submit forms.
Here's some talk about how to handle clicking.
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/2eed72f7-4fde-4730-abf7-738e9b6e87c4/
I've used that approach successfully in the past, but I will say it's problematic if you don't/can't control the website. If I write a program that will automate logging into facebook with this method it would require me telling it what URL to visit, what textboxes to fill, and what form name or button name to click.
If Facebook redesigns their layout - my code may no longer work.
If you are just interested in the logging in part; you might want to take a look at browser addons (I don't know if this will help at all, but I thought I would mention it). I use a product called, 'LastPass' (https://lastpass.com/) and it manages all of my user names and passwords. If I visit a site it is familiar with, it can automatically fill in the forms for me, allowing me to log in or completely enter my address.

Display a C# message onlyonce

I would like to make a C# application that displays a message when the program starts up, with a button that says "Don't show this message again".
When they click that button, how do I make it not display again the next time the program is ran.
Any and all help would be greatly appreciated.
Also, I'm unsure on how to show a message with a button in it (new to c#) so help on that would be appreciated also.
You could save this choice in the user settings.
You just need to record that setting somewhere that lives beyond the current life of the program.
You can use the Settings part of your project for this.
As for adding such a checkbox or whatever, you probably have to create a new form that looks like a message box.
You will have to store a value indicating the whether the user has clicked the box or not in an xml file, database, etc.
Assuming this is WinForms the message will be a MessageBox or a new Form.
As an alternative to user settings, both the registry and isolated storage provide valid places to store your data. One appeal of isolated storage is that you have a whole mini-file-system at your disposal, which can be convenient for very complex storage. In this specific case, however, either user settings or registry settings will provide maximum simplicity, IMO.

Categories

Resources