public AdoDataTest() { gender = new models.Gender() { Name = "TestGender" }; }
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); }