locked
How to make personal databases?

    Question

  • I want to make a database where you can make a username and password, have it save the username and password, log in, and then have access to only your section of the database where you can record you recent miles ran. I only know how to make one database that everyone sees, I want to make it so that each person has their own separate space. Any help is greatly appreciated!
    Sunday, October 23, 2011 12:31 AM

Answers

  • Hi nnacho528,

    The best way to do this would be to use SQL Server CE (compact edition) database to your application.  It's a local database file that can be specific to just the user's machine.  To add one, you just select Add New Item to your project and select "Local Database".  From there, it will create an empty SQL Server CE database (Database1.sdf) and a empty DataSet.  You can now create tables and do whatever you need to setup the personal database. 


    Tom Overton
    Sunday, October 23, 2011 12:42 AM
  • Hi,

    How do you mean by make it personalized?   SQL Server CE only supports multiple connections within the same OS session, so it cannot let different Windows users to access the db file.   I would recommend you use SQL Server dbs or if you want to create your own db format, I think you can consider making a user table to store all the user information and let all other tables be related to this table.   Only the user uses the correct username and password to access the user table, he can get a token or something similar to access other related tables. 

    Good day!


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, October 24, 2011 10:12 AM
    Moderator

All replies

  • Hi nnacho528,

    The best way to do this would be to use SQL Server CE (compact edition) database to your application.  It's a local database file that can be specific to just the user's machine.  To add one, you just select Add New Item to your project and select "Local Database".  From there, it will create an empty SQL Server CE database (Database1.sdf) and a empty DataSet.  You can now create tables and do whatever you need to setup the personal database. 


    Tom Overton
    Sunday, October 23, 2011 12:42 AM
  • thanks but how do I make it personalized to each person's log in, or do I have to make it personalized on that computer?
    Sunday, October 23, 2011 12:45 AM
  • Hi,

    How do you mean by make it personalized?   SQL Server CE only supports multiple connections within the same OS session, so it cannot let different Windows users to access the db file.   I would recommend you use SQL Server dbs or if you want to create your own db format, I think you can consider making a user table to store all the user information and let all other tables be related to this table.   Only the user uses the correct username and password to access the user table, he can get a token or something similar to access other related tables. 

    Good day!


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, October 24, 2011 10:12 AM
    Moderator