Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 41509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:11:31+00:00 2026-05-10T15:11:31+00:00

I am having a really hard time attempting to debug LINQ to SQL and

  • 0

I am having a really hard time attempting to debug LINQ to SQL and submitting changes.

I have been using http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx, which works great for debugging simple queries.

I’m working in the DataContext Class for my project with the following snippet from my application:

JobMaster newJobToCreate = new JobMaster(); newJobToCreate.JobID = 9999 newJobToCreate.ProjectID = 'New Project'; this.UpdateJobMaster(newJobToCreate); this.SubmitChanges(); 

I will catch some very odd exceptions when I run this.SubmitChanges;

Index was outside the bounds of the array. 

The stack trace goes places I cannot step into:

at System.Data.Linq.IdentityManager.StandardIdentityManager.MultiKeyManager`3.TryCreateKeyFromValues(Object[] values, MultiKey`2& k)    at System.Data.Linq.IdentityManager.StandardIdentityManager.IdentityCache`2.Find(Object[] keyValues)    at System.Data.Linq.IdentityManager.StandardIdentityManager.Find(MetaType type, Object[] keyValues)    at System.Data.Linq.CommonDataServices.GetCachedObject(MetaType type, Object[] keyValues)    at System.Data.Linq.ChangeProcessor.GetOtherItem(MetaAssociation assoc, Object instance)    at System.Data.Linq.ChangeProcessor.BuildEdgeMaps()    at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)    at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)    at System.Data.Linq.DataContext.SubmitChanges()    at JobTrakDataContext.CreateNewJob(NewJob job, String userName) in D:\JobTrakDataContext.cs:line 1119 

Does anyone have any tools or techniques they use? Am I missing something simple?

EDIT: I’ve setup .net debugging using Slace’s suggestion, however the .net 3.5 code is not yet available: http://referencesource.microsoft.com/netframework.aspx

EDIT2: I’ve changed to InsertOnSubmit as per sirrocco’s suggestion, still getting the same error.

EDIT3: I’ve implemented Sam’s suggestions trying to log the SQL generated and to catch the ChangeExceptoinException. These suggestions do not shed any more light, I’m never actually getting to generate SQL when my exception is being thrown.

EDIT4: I found an answer that works for me below. Its just a theory but it has fixed my current issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:11:32+00:00Added an answer on May 10, 2026 at 3:11 pm

    First, thanks everyone for the help, I finally found it.

    The solution was to drop the .dbml file from the project, add a blank .dbml file and repopulate it with the tables needed for my project from the ‘Server Explorer’.

    I noticed a couple of things while I was doing this:

    • There are a few tables in the system named with two words and a space in between the words, i.e. ‘Job Master’. When I was pulling that table back into the .dbml file it would create a table called ‘Job_Master’, it would replace the space with an underscore.
    • In the orginal .dbml file one of my developers had gone through the .dbml file and removed all of the underscores, thus ‘Job_Master’ would become ‘JobMaster’ in the .dbml file. In code we could then refer to the table in a more, for us, standard naming convention.
    • My theory is that somewhere, the translation from ‘JobMaster’ to ‘Job Master’ while was lost while doing the projection, and I kept coming up with the array out of bounds error.

    It is only a theory. If someone can better explain it I would love to have a concrete answer here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You can use the Nant tasks provided with WiX, see… May 11, 2026 at 3:34 pm
  • added an answer Part of me wonders whether it's something to do with… May 11, 2026 at 3:34 pm
  • added an answer Use Dictionary<int, Customer> instead. It supports O(1) lookup based on… May 11, 2026 at 3:34 pm

Related Questions

I am having a really hard time reconciling IoC, interfaces, and events. Let's see
I'm relatively new to Object Oriented Programming. I pretty much understand the concepts, but
I am using Windows Installer XML 3.0 (WIX3) to install some software. Everything works
Anyone using colorjack? Someone here on SO mentioned it the other day, so I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.