Пример #1
0
        public void Create(Familia familia)
        {
            string cnx = db.Database.Connection.ConnectionString;

            con = new SqlConnection(cnx);
            try
            {
                comando = new SqlCommand("usp_FamiliaInsert", con);
                comando.Parameters.AddWithValue("@Nombre", familia.Nombre);
                comando.CommandType = System.Data.CommandType.StoredProcedure;
                con.Open();
                comando.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
        }