Click here to Skip to main content
15,886,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
i am designing a Login form---(windows application using C sharp and MS SQL server).

i want the logic and code how to save the login data so that when user returns next time he finds all ready username and password written for him.

i know that this can be done by storing the login data in app.config
can you show the way of writing to xml file app.config and then retreiving the needed username and password from it.
please i am stocked Google is not helping me neither the search results from codeprject.

it would be great if someone of you makes a loginform with the above requirments with comments in code to understand whats happining

Thanks
Posted

Don't use the app.config file for this. You would need the current user name associated with the login information in the database, then when your app starts up you can retrieve the information based on the user name
 
Share this answer
 
can anybody give us a sample project ?

please...
 
Share this answer
 
Comments
Yusuf 20-Aug-10 10:02am    
Reason for my vote of 1
Writing a sample project is left as exercise for you.
you can use Settings object of .Net
you can add your own setting object by adding new item or you can directly add in your Project Properties's Settings tab

which can able to store data as database without any query or XML syntax

:)
 
Share this answer
 
Comments
[no name] 29-Aug-10 15:16pm    
Reason for my vote of 1
Settings are stored in the app.config file and are still not the appropriate place for such information
Khaniya 30-Aug-10 2:28am    
Mark I know app.config is not a suitable place
But questioner asking
"can you show the way of writing to xml file app.config"
thats why I suggestion Settings object

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900