Я сделал эту строку кода, но значение не обновляется. Я использовал для этого контроль rad.
db.MergeOption = MergeOption.OverwriteChanges;
var c1 = (from c in db.Currency where c.ThreeLetterIsoCode == "1" select c).First();
c1.ThreeLetterIsoCode = "Updatesd";
db.UpdateObject(c1);
db.SaveChanges();
radDataServiceDataSource1.SubmitChanges();
Нет исключения, но оно не обновляется.
Служба:
public static void InitializeService(DataServiceConfiguration config)
{
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
// Examples:
// config.SetEntitySetAccessRule("MyEntityset", EntitySetRights.AllRead);
// config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
config.SetEntitySetAccessRule("*", EntitySetRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
protected override ObjectContext CreateDataSource()
{
BaazaarDbContext nw = new BaazaarDbContext();
// Configure DbContext before we provide it to the
// data services runtime.
nw.Configuration.ValidateOnSaveEnabled = false;
// Get the underlying ObjectContext for the DbContext.
var context = ((IObjectContextAdapter)nw).ObjectContext;
// Return the underlying context.
return context;
}
Я вставил строку, которую вставили.Пожалуйста, помогите в этом.