Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity context does not update database
    primarykey
    data
    text
    <p>Somehow my entity data context does not update database.. In .Net framework I did the following:</p> <ol> <li><p>Created entity model like here: <a href="http://msdn.microsoft.com/en-us/library/bb399739(v=vs.90" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb399739(v=vs.90</a>) with the table = entity named "Level".</p></li> <li><p>Added in code new context for this model:</p> <pre><code>Main_dataBaseEntities context; //... context = new Main_dataBaseEntities; </code></pre></li> <li><p>Added new object of the "Level" entity with Path property:</p> <pre><code>var z = new Level {Path = "zPath"}; context.Level.AddObject(z); </code></pre></li> <li><p>Saved changes:</p> <pre><code>context.SaveChanges(); </code></pre></li> </ol> <p>Databases table shows nothing.. How can I add new item ?))</p> <p>My Entity class created by Entity framework on the base of database is as follows:</p> <pre><code>//------------------------------------------------------------------------------ // &lt;auto-generated&gt; // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // &lt;/auto-generated&gt; //------------------------------------------------------------------------------ using System; using System.Data.Objects; using System.Data.Objects.DataClasses; using System.Data.EntityClient; using System.ComponentModel; using System.Xml.Serialization; using System.Runtime.Serialization; [assembly: EdmSchemaAttribute()] #region EDM Relationship Metadata [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Terminals_Brokers", "Broker", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Broker), "Terminal", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Terminal), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Clients_Terminals", "Terminal", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Terminal), "Client", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Client), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_ClientsTickers_Clients", "Client", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Client), "ClientTicker", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.ClientTicker), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Risks_Clients", "Client", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Client), "Risk", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Risk), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_ClientsTickers_Tickers", "Ticker", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Ticker), "ClientTicker", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.ClientTicker), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Tickers_Currencies", "Currency", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Currency), "Ticker", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Ticker), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Levels_Strategies", "Strategy", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Strategy), "Level", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Level), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Levels_Tickers", "Ticker", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Ticker), "Level", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Level), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Transactions_Levels", "Level", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Level), "Transaction", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Transaction), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Risks_Strategies", "Strategy", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Strategy), "Risk", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Risk), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Risks_Tickers", "Ticker", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Ticker), "Risk", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Risk), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Transaction_Risk", "Risk", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Risk), "Transaction", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Transaction), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Transactions_Statuses", "Status", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.Status), "Transaction", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Transaction), true)] [assembly: EdmRelationshipAttribute("Main_dataBaseModel", "FK_Terminals_TerminalTypes", "TerminalType", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(trust_manager_v_1._0.TerminalType), "Terminal", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(trust_manager_v_1._0.Terminal), true)] #endregion namespace trust_manager_v_1._0 { #region Contexts /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public partial class Main_dataBaseEntities : ObjectContext { #region Constructors /// &lt;summary&gt; /// Initializes a new Main_dataBaseEntities object using the connection string found in the 'Main_dataBaseEntities' section of the application configuration file. /// &lt;/summary&gt; public Main_dataBaseEntities() : base("name=Main_dataBaseEntities", "Main_dataBaseEntities") { this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } /// &lt;summary&gt; /// Initialize a new Main_dataBaseEntities object. /// &lt;/summary&gt; public Main_dataBaseEntities(string connectionString) : base(connectionString, "Main_dataBaseEntities") { this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } /// &lt;summary&gt; /// Initialize a new Main_dataBaseEntities object. /// &lt;/summary&gt; public Main_dataBaseEntities(EntityConnection connection) : base(connection, "Main_dataBaseEntities") { this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } #endregion #region Partial Methods partial void OnContextCreated(); #endregion #region ObjectSet Properties /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Broker&gt; Broker { get { if ((_Broker == null)) { _Broker = base.CreateObjectSet&lt;Broker&gt;("Broker"); } return _Broker; } } private ObjectSet&lt;Broker&gt; _Broker; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Client&gt; Client { get { if ((_Client == null)) { _Client = base.CreateObjectSet&lt;Client&gt;("Client"); } return _Client; } } private ObjectSet&lt;Client&gt; _Client; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;ClientTicker&gt; ClientTicker { get { if ((_ClientTicker == null)) { _ClientTicker = base.CreateObjectSet&lt;ClientTicker&gt;("ClientTicker"); } return _ClientTicker; } } private ObjectSet&lt;ClientTicker&gt; _ClientTicker; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Currency&gt; Currency { get { if ((_Currency == null)) { _Currency = base.CreateObjectSet&lt;Currency&gt;("Currency"); } return _Currency; } } private ObjectSet&lt;Currency&gt; _Currency; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Level&gt; Level { get { if ((_Level == null)) { _Level = base.CreateObjectSet&lt;Level&gt;("Level"); } return _Level; } } private ObjectSet&lt;Level&gt; _Level; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Risk&gt; Risk { get { if ((_Risk == null)) { _Risk = base.CreateObjectSet&lt;Risk&gt;("Risk"); } return _Risk; } } private ObjectSet&lt;Risk&gt; _Risk; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Status&gt; Status { get { if ((_Status == null)) { _Status = base.CreateObjectSet&lt;Status&gt;("Status"); } return _Status; } } private ObjectSet&lt;Status&gt; _Status; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Strategy&gt; Strategy { get { if ((_Strategy == null)) { _Strategy = base.CreateObjectSet&lt;Strategy&gt;("Strategy"); } return _Strategy; } } private ObjectSet&lt;Strategy&gt; _Strategy; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;sysdiagrams&gt; sysdiagrams { get { if ((_sysdiagrams == null)) { _sysdiagrams = base.CreateObjectSet&lt;sysdiagrams&gt;("sysdiagrams"); } return _sysdiagrams; } } private ObjectSet&lt;sysdiagrams&gt; _sysdiagrams; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Terminal&gt; Terminal { get { if ((_Terminal == null)) { _Terminal = base.CreateObjectSet&lt;Terminal&gt;("Terminal"); } return _Terminal; } } private ObjectSet&lt;Terminal&gt; _Terminal; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;TerminalType&gt; TerminalType { get { if ((_TerminalType == null)) { _TerminalType = base.CreateObjectSet&lt;TerminalType&gt;("TerminalType"); } return _TerminalType; } } private ObjectSet&lt;TerminalType&gt; _TerminalType; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Ticker&gt; Ticker { get { if ((_Ticker == null)) { _Ticker = base.CreateObjectSet&lt;Ticker&gt;("Ticker"); } return _Ticker; } } private ObjectSet&lt;Ticker&gt; _Ticker; /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public ObjectSet&lt;Transaction&gt; Transaction { get { if ((_Transaction == null)) { _Transaction = base.CreateObjectSet&lt;Transaction&gt;("Transaction"); } return _Transaction; } } private ObjectSet&lt;Transaction&gt; _Transaction; #endregion #region AddTo Methods /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Broker EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToBroker(Broker broker) { base.AddObject("Broker", broker); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Client EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToClient(Client client) { base.AddObject("Client", client); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the ClientTicker EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToClientTicker(ClientTicker clientTicker) { base.AddObject("ClientTicker", clientTicker); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Currency EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToCurrency(Currency currency) { base.AddObject("Currency", currency); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Level EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToLevel(Level level) { base.AddObject("Level", level); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Risk EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToRisk(Risk risk) { base.AddObject("Risk", risk); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Status EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToStatus(Status status) { base.AddObject("Status", status); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Strategy EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToStrategy(Strategy strategy) { base.AddObject("Strategy", strategy); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the sysdiagrams EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddTosysdiagrams(sysdiagrams sysdiagrams) { base.AddObject("sysdiagrams", sysdiagrams); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Terminal EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToTerminal(Terminal terminal) { base.AddObject("Terminal", terminal); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the TerminalType EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToTerminalType(TerminalType terminalType) { base.AddObject("TerminalType", terminalType); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Ticker EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToTicker(Ticker ticker) { base.AddObject("Ticker", ticker); } /// &lt;summary&gt; /// Deprecated Method for adding a new object to the Transaction EntitySet. Consider using the .Add method of the associated ObjectSet&amp;lt;T&amp;gt; property instead. /// &lt;/summary&gt; public void AddToTransaction(Transaction transaction) { base.AddObject("Transaction", transaction); } #endregion } #endregion #region Entities /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmEntityTypeAttribute(NamespaceName="Main_dataBaseModel", Name="Broker")] [Serializable()] [DataContractAttribute(IsReference=true)] public partial class Broker : EntityObject { #region Factory Method /// &lt;summary&gt; /// Create a new Broker object. /// &lt;/summary&gt; /// &lt;param name="id"&gt;Initial value of the ID property.&lt;/param&gt; public static Broker CreateBroker(global::System.Guid id) { Broker broker = new Broker(); broker.ID = id; return broker; } #endregion #region Primitive Properties /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] [DataMemberAttribute()] public global::System.Guid ID { get { return _ID; } set { if (_ID != value) { OnIDChanging(value); ReportPropertyChanging("ID"); _ID = StructuralObject.SetValidValue(value); ReportPropertyChanged("ID"); OnIDChanged(); } } } private global::System.Guid _ID; partial void OnIDChanging(global::System.Guid value); partial void OnIDChanged(); /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] [DataMemberAttribute()] public global::System.String Name { get { return _Name; } set { OnNameChanging(value); ReportPropertyChanging("Name"); _Name = StructuralObject.SetValidValue(value, true); ReportPropertyChanged("Name"); OnNameChanged(); } } private global::System.String _Name; partial void OnNameChanging(global::System.String value); partial void OnNameChanged(); #endregion #region Navigation Properties /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [XmlIgnoreAttribute()] [SoapIgnoreAttribute()] [DataMemberAttribute()] [EdmRelationshipNavigationPropertyAttribute("Main_dataBaseModel", "FK_Terminals_Brokers", "Terminal")] public EntityCollection&lt;Terminal&gt; Terminal { get { return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection&lt;Terminal&gt;("Main_dataBaseModel.FK_Terminals_Brokers", "Terminal"); } set { if ((value != null)) { ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection&lt;Terminal&gt;("Main_dataBaseModel.FK_Terminals_Brokers", "Terminal", value); } } } #endregion } /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmEntityTypeAttribute(NamespaceName="Main_dataBaseModel", Name="Client")] [Serializable()] [DataContractAttribute(IsReference=true)] public partial class Client : EntityObject { #region Factory Method /// &lt;summary&gt; /// Create a new Client object. /// &lt;/summary&gt; /// &lt;param name="id"&gt;Initial value of the ID property.&lt;/param&gt; public static Client CreateClient(global::System.Guid id) { Client client = new Client(); client.ID = id; return client; } #endregion #region Primitive Properties /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] [DataMemberAttribute()] public global::System.Guid ID { get { return _ID; } set { if (_ID != value) { OnIDChanging(value); ReportPropertyChanging("ID"); _ID = StructuralObject.SetValidValue(value); ReportPropertyChanged("ID"); OnIDChanged(); } } } private global::System.Guid _ID; partial void OnIDChanging(global::System.Guid value); partial void OnIDChanged(); /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] [DataMemberAttribute()] public global::System.String Name { get { return _Name; } set { OnNameChanging(value); ReportPropertyChanging("Name"); _Name = StructuralObject.SetValidValue(value, true); ReportPropertyChanged("Name"); OnNameChanged(); } } private global::System.String _Name; partial void OnNameChanging(global::System.String value); partial void OnNameChanged(); /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] [DataMemberAttribute()] public global::System.String Account { get { return _Account; } set { OnAccountChanging(value); ReportPropertyChanging("Account"); _Account = StructuralObject.SetValidValue(value, true); ReportPropertyChanged("Account"); OnAccountChanged(); } } private global::System.String _Account; partial void OnAccountChanging(global::System.String value); partial void OnAccountChanged(); /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] [DataMemberAttribute()] public global::System.String Comment { get { return _Comment; } set { OnCommentChanging(value); ReportPropertyChanging("Comment"); _Comment = StructuralObject.SetValidValue(value, true); ReportPropertyChanged("Comment"); OnCommentChanged(); } } private global::System.String _Comment; partial void OnCommentChanging(global::System.String value); partial void OnCommentChanged(); /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] [DataMemberAttribute()] public Nullable&lt;global::System.Single&gt; Assets { get { return _Assets; } set { OnAssetsChanging(value); ReportPropertyChanging("Assets"); _Assets = StructuralObject.SetValidValue(value); ReportPropertyChanged("Assets"); OnAssetsChanged(); } } private Nullable&lt;global::System.Single&gt; _Assets; partial void OnAssetsChanging(Nullable&lt;global::System.Single&gt; value); partial void OnAssetsChanged(); /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] [DataMemberAttribute()] public global::System.String Virtual_Assets { get { return _Virtual_Assets; } set { OnVirtual_AssetsChanging(value); ReportPropertyChanging("Virtual_Assets"); _Virtual_Assets = StructuralObject.SetValidValue(value, true); ReportPropertyChanged("Virtual_Assets"); OnVirtual_AssetsChanged(); } } private global::System.String _Virtual_Assets; partial void OnVirtual_AssetsChanging(global::System.String value); partial void OnVirtual_AssetsChanged(); /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [EdmScalarPropertyAttri </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload