<section>
<h2>Explore New Videos!</h2>
<iframe width="700" height="397" src="https://unsplash.it/200" frameborder="0" allowfullscreen >
</iframe>
</section>
<aside>
<div class = "news-feed">
<img src="https://unsplash.it/700" height="15%" width="5%">
<div class = "summary">
<p>This is text</p>
</div>
</div>
</aside>
上述代码中的EmployeeDbContex contex = new EmployeeDbContex();
tbl_Employee Employee = new tbl_Employee();
Employee.Name = txtname.Text.Trim();
Employee.Address = txtAddress.Text.Trim();
Employee.Salary = Convert.ToDecimal(txtSalary.Text.Trim());
Employee.Gender = ddGender.SelectedItem.Text;
Employee.ContactNo = txtContact.Text.Trim();
contex.tbl_Employee.Add(Employee);
contex.SaveChanges();
方法无效。这些值分配给属性,但在插入新数据时不会在数据库中进行更改。
然而,当我执行删除时,它完美无缺。当我在调试模式下检查程序时,控件只是通过SaveChanges()
方法,并没有跳转到此方法的定义。