I’m at my first windows phone 7 app that uses databases. I’ve created a database that has 4 Tables:
namespace database
{
public class AccountDataContext : DataContext
{
public AccountDataContext(string connectionString)
: base(connectionString)
{
}
public Table<Account> Accounts
{
get
{
return this.GetTable<Account>();
}
}
public Table<user> users
{
get
{
return this.GetTable<user>();
}
}
public Table<link> links
{
get
{
return this.GetTable<link>();
}
}
public Table<player> players
{
get
{
return this.GetTable<player>();
}
}
}
}
and i made a login page where you can login or register a new user…
The ‘problem’ is that every user that registers and logs in can see the same data .
I want to know how to split(or something) the database so that the tables: Account, link and player would be specific to every user that is added in the “user” table. Or should i make a new database for every new user that registers?
just add a ‘user ID’ field in every table class(account.cs links.cs player.cs). When logging-in, saving the userID(corresponding to the user that logged in) in the database and when adding a new account, link or player information just adding the ‘user ID’ corresponding to the current session too