This is a migrated thread and some comments may be shown as answers.

Stack Strace Error Help

1 Answer 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aaron
Top achievements
Rank 1
Aaron asked on 09 Jan 2013, 03:59 AM

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.

1 Answer, 1 is accepted

Sort by
0
Paul Wade
Top achievements
Rank 1
answered on 31 Jul 2013, 05:57 PM
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?
Tags
General Discussions
Asked by
Aaron
Top achievements
Rank 1
Answers by
Paul Wade
Top achievements
Rank 1
Share this question
or