Stack Strace Error Help

2 posts, 0 answers
  1. Aaron
    Aaron avatar
    13 posts
    Member since:
    Dec 2012

    Posted 08 Jan 2013 Link to this post

    Hi I got the following stack trace from one of my windows phone 8 applications which was called from the background agent called ScheduledTaskAgent1 while call a routine UpdateUI() from what I can gather:

    Frame    Image                                   Function                                                                                                                   Offset        
    0        Microsoft.Phone.Data.Internal.ni.dll    System.Data.SqlServerCe.SqlCeConnection.Open                                                                               0x00000534    
    1        Microsoft.Phone.Data.Internal.ni.dll    System.Data.SqlServerCe.SqlCeConnection.Open                                                                               0x00000006    
    2        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection                                                              0x0000008c    
    3        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlProvider.Execute                                                                             0x00000038    
    4        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll                                                                          0x00000080    
    5        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute                                         0x0000026c    
    6        System.Data.Linq.ni.dll                 System.Data.Linq.DataQuery_1[[System.__Canon,_mscorlib]].System.Linq.IQueryProvider.Execute[[System.__Canon,_mscorlib]]    0x00000040    
    7        System.Core.ni.dll                      System.Linq.Queryable.FirstOrDefault[[System.__Canon,_mscorlib]]                                                           0x00000106    
    8        ScheduledTaskAgent1.ni.DLL              ScheduledTaskAgent1.ScheduledAgent.UpdateUI                                                                                0x0000020a    
    9        ScheduledTaskAgent1.ni.DLL              ScheduledTaskAgent1.ScheduledAgent.OnInvoke                                                                                0x00000078    
    10       Microsoft.Phone.ni.dll                  Microsoft.Phone.Scheduler.ScheduledTaskAgent.Invoke                                                                        0x00000432    
    11       Microsoft.Phone.ni.dll                  Microsoft.Phone.BackgroundAgentDispatcher+AgentRequest.Invoke                                                              0x00000344    
    12       Microsoft.Phone.ni.dll                  Microsoft.Phone.BackgroundAgentDispatcher.InvocationThread                                                                 0x00000080    
    13       mscorlib.ni.dll                         System.Threading.ThreadHelper.ThreadStart_Context                                                                          0x0000008a    
    14       mscorlib.ni.dll                         System.Threading.ExecutionContext.RunInternal                                                                              0x00000088    
    15       mscorlib.ni.dll                         System.Threading.ExecutionContext.Run                                                                                      0x00000010    
    16       mscorlib.ni.dll                         System.Threading.ExecutionContext.Run                                                                                      0x00000042    
    17       mscorlib.ni.dll                         System.Threading.ThreadHelper.ThreadStart                                                                                  0x00000042

    I am trying to understand what this means and the routine for UpdateUI() is as follows:


    private void UpdateUI()
            {
                // all variables I have commented out
    
                // Get the database context
                using (db context = new db(ConnectionString))
                {
                    try 
                    {
                        strTest = (from c in context.Setting
                                       where c.Code == "TEST"
                                       select c.Value).FirstOrDefault();
                    }
                       catch (Exception)
                       {
                              // Do nothing for now
                       }
                }
                
                    // Get database context
                    using (db context = new db(ConnectionString))
                    {
                        try
                        {
                            My_template dbMy_template  = new My_template();
                            dbMy_template.myDate = System.DateTime.Now.ToString();
                            dbMy_template.myValue= myInt.ToString();
                            context.My_template.InsertOnSubmit(dbMy_template);
                            context.SubmitChanges();
                        }
                        catch (Exception ex)
                        {
                            // Do nothing for now
                        }
               }
            }
    Thank you for all your help on this.  Any ideas or sample on how to do this would be great.
  2. Paul Wade
    Paul Wade avatar
    8 posts
    Member since:
    Oct 2008

    Posted 31 Jul 2013 Link to this post

    A couple of thoughts your try catch blocks in the using are swallowing any errors so you may not be seeing the real problem. Add a throw there at least or make sure you have a breakpoint set in the catch while debugging. Also could the error be coming from the new db constructor? You could move your catch to include the using to see if you can get a more useful error?
  3. DevCraft banner
Back to Top