Esempio n. 1
0
 public AdoDataTest()
 {
     gender = new models.Gender()
     {
         Name = "TestGender"
     };
 }
Esempio n. 2
0
        public bool InsertGender(mod.Gender gender)
        {
            var name  = new SqlParameter("name", gender.Name);
            var query = "insert into Monster.Gender(GenderName, Active) values(@name, 1)";

            /* SqlCommand cmd;
             * int result;
             *
             * using (var connection = new SqlConnection(connectionString))
             * {
             * connection.Open();
             * cmd = new SqlCommand(query, connection);
             * cmd.Parameters.Add(name);
             * result = cmd.ExecuteNonQuery();
             * }*/
            return(InsertData(query, name) == 1);
        }