Exemplo n.º 1
0
        static void Main(string[] args)
        {
            EmployeeInfo e1 = new EmployeeInfo {
                Name = "Deepak", Dept = "Training", Salary = 15000
            };
            EmployeeInfo e2 = new EmployeeInfo {
                Name = "Martin", Dept = "Accouont", Salary = 18000
            };
            CodeDBEntities db = new CodeDBEntities();

            db.EmployeeInfos.Add(e1);
            db.EmployeeInfos.Add(e2);
            var reult = db.SaveChanges();

            if (reult > 0)
            {
                Console.WriteLine("Data Inserted.");
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            EmplyoeeInfo e1 = new EmplyoeeInfo {
                name = "Sai", dept = "training", salary = 45000
            };
            EmplyoeeInfo e2 = new EmplyoeeInfo {
                name = "teja", dept = "Accounts", salary = 22000
            };
            CodeDBEntities db = new CodeDBEntities();

            db.EmployeeInfos.Add(e1);
            db.EmployeeInfos.Add(e2);
            var res = db.SaveChanges();

            if (res > 0)
            {
                Console.WriteLine("Data Inserted");
            }
        }