Ejemplo n.º 1
0
 public IList<User_details> GetAllUsers()
 {
     IList<User_details> list = null;
     using (UserDataContext context = new UserDataContext(UserDataContext.DBConnectionString))
     {
         IQueryable<User_details> query = from c in context.Users select c;
         list = query.ToList();
     }
     return list;
 }
Ejemplo n.º 2
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     using (UserDataContext context = new UserDataContext(UserDataContext.DBConnectionString))
     {
         if (!context.DatabaseExists())
             context.CreateDatabase();
     }
     // Sample code to localize the ApplicationBar
     //BuildLocalizedApplicationBar();
 }
Ejemplo n.º 3
0
 public void AddUser(String name, String email)
 {
     using (UserDataContext context = new UserDataContext(UserDataContext.DBConnectionString))
     {
         User_details du = new User_details();
         du.user_name = name;
         du.user_email = email;
         context.Users.InsertOnSubmit(du);
         context.SubmitChanges();
     }
 }