Esempio n. 1
0
 public void Add(User user)
 {
     using (var connection = new SqlConnection(_connectionString))
     {
         var command = new SqlCommand("INSERT INTO [Users] (Name, Password) VALUES (@Name, @Password)", connection);
         command.Parameters.Add(new SqlParameter("@Name", user.Name));
         command.Parameters.Add(new SqlParameter("@Password", user.Password));
         connection.Open();
         command.ExecuteNonQuery();
     }
 }
Esempio n. 2
0
 public void CreateUser(User user)
 {
     Dao.UserAccess.Add(user);
 }