0
我有一个包含五个字段的表格。我想通过点击一个字段来更新其中的任何一个。但我不知道哪些领域将被修改,这意味着列名不predefined.My代码是在这里如何更新列名称为动态的表格列
public void Edit(int Id, string field, string oldValue, string newValue, object customer)
{
BanglaFireExt.DAL.ExtDotNetEntities db = new BanglaFireExt.DAL.ExtDotNetEntities();
string message = "<b>Property:</b> {0}<br /><b>Field:</b> {1}<br /><b>Old Value:</b> {2}<br /><b>New Value:</b> {3}";
var obj = db.Employees.Single(x=>x.Id==Id);
**obj.field=newValue;**//here field is a string, but there is a column in table named **field value**
db.SaveChanges();
}
我如何将字符串转换为表列类型。请帮助我
非常感谢,它完美的作品,我想要什么 – 2014-11-22 19:20:35