Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot get to ObjectTrackingEnabled linq
    primarykey
    data
    text
    <p>I have had a problem where it appeared as though the second execution of a stored procedure was being ignored.</p> <p>The first time I call my stored procedure it found 20 records and extracted information for the date range August 2009. The first line was meter id 233 with a data value 200</p> <p>I then called the stored procedure and 20 records were also returned. This time meter id 233 had a data value of 300.</p> <p>Linq is detecting that meterid 233 already exists in the context and so doesnt update</p> <p>I am sure this is something to do with ObjectTrackingEnabled but this does not seem to be available for me to set to false?</p> <p>I didnt write the context code so I dont really know how it all works, but I have noticed that it seems to inherit from ObjectDataContext</p> <p>This was generate using Entity Framework and VS 2008</p> <p>namespace DataServiceDAL {</p> <pre><code>/// &lt;summary&gt; /// There are no comments for dbChildDataContext in the schema. /// &lt;/summary&gt; public partial class dbChildDataContext : global::System.Data.Objects.ObjectContext { /// &lt;summary&gt; /// Initializes a new dbChildDataContext object using the connection string found in the 'dbChildDataContext' section of the application configuration file. /// &lt;/summary&gt; public dbChildDataContext() : base("name=dbChildDataContext", "dbChildDataContext") { this.OnContextCreated(); } /// &lt;summary&gt; /// Initialize a new dbChildDataContext object. /// &lt;/summary&gt; public dbChildDataContext(string connectionString) : base(connectionString, "dbChildDataContext") { this.OnContextCreated(); } /// &lt;summary&gt; /// Initialize a new dbChildDataContext object. /// &lt;/summary&gt; public dbChildDataContext(global::System.Data.EntityClient.EntityConnection connection) : base(connection, "dbChildDataContext") { this.OnContextCreated(); } partial void OnContextCreated(); </code></pre> <p>.............. }</p> <p>I use the following linq to extract the data</p> <pre><code> public static List&lt;MeterTotalConsumpRecord&gt; GetTotalAllTimesConsumption(DateTime dtStart, DateTime dtEnd, EUtilityGroup ug, int nMeterSelectionType, int nCustomerID, int nUserID, string strSelection, bool bClosedLocations, bool bDisposedLocations) { dbChildDataContext db = DBManager.ChildDataConext(nCustomerID); var tbl = from t in db.GetTotalConsumptionByMeter(dtStart, dtEnd, (int) ug, nMeterSelectionType, nCustomerID, nUserID, strSelection, bClosedLocations, bDisposedLocations, 1) select t; return tbl.ToList(); } </code></pre> <p>I need a way of clearing this cache out so that the objects are updated properly or I need a way of refreshing the objects </p> <p>Can anyone help?</p> <p>Cheers</p> <p>Paul</p>
    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.
    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