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

  • SEARCH
  • Home
  • 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 6538355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:43:34+00:00 2026-05-25T10:43:34+00:00

I have a really odd problem. I have 3 tables. Positions PositionAttachments Attachments I

  • 0

I have a really odd problem.

I have 3 tables.

  1. Positions
  2. PositionAttachments
  3. Attachments

I won’t bore you with the keys and foreign keys as that should be kinda evident.

If I add a new position, attachment and positionattachment all’s well.

If I add a new attachment to an existing Position record i get the following.

  1. Positions table is updated and I can see changes on screen
  2. Attachment table has new record
  3. PositionAttachments table has new record
  4. New Attachment does not appear on screen within my application
  5. Close application, recompile and re run and I have the same as 4
  6. View ANY table through SQL server and I get kicked out of my session and once I log back in I see the records on screen.

At no point is there an error being generated.

Update record code;

    public void AddAttachmentToPosition(PositionsAvailable positionModel, Attachment attachment)
    {
        //attachment.id = Guid.NewGuid();
        dc.Attachments.InsertOnSubmit(attachment);

        PositionAttachment positionAttachment = new PositionAttachment();
        positionAttachment.PositionId = positionModel.PositionId;
        positionAttachment.AttachmentId = attachment.id;
        //positionAttachment.id = Guid.NewGuid();

        dc.PositionAttachments.InsertOnSubmit(positionAttachment);
        dc.SubmitChanges();
    }

Edit

I have looked at the log produced by the Data context and I get this for the PositionAttachments insert. It looks essentially the same for the Attachments table.

DECLARE @output TABLE([id] UniqueIdentifier)
INSERT INTO [dbo].[PositionAttachments]([PositionId], [AttachmentId])
OUTPUT INSERTED.[id] INTO @output
VALUES (@p0, @p1)
SELECT [id] FROM @output
-- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [92a3627d-ad01-466e-a315-423c851efc5d]
-- @p1: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [db566728-a313-40c7-af82-0a2f147234eb]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.5420

To my mind, this looks pretty normal. And besides, the same code works when I am adding a new Position just not when I am adding attachments to an existing position.

  • 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. Editorial Team
    Editorial Team
    2026-05-25T10:43:35+00:00Added an answer on May 25, 2026 at 10:43 am

    Just a hunch, what if you try:

        PositionAttachment positionAttachment = new PositionAttachment(); 
        positionAttachment.Position = positionModel; 
        positionAttachment.Attachmen = attachment; 
    

    Although I think the DC should also pick up the ID’s properly

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

Sidebar

Related Questions

I am having a really odd problem with Flash CS4. I have a MovieClip
I have an extremely odd problem in my JUnit tests that I just can't
I have a really odd problem. I am using an upload form to upload
I asked a similar question yesterday, but have acquired a really odd problem since
I have a really odd issue with an ItemRenderer. I have a main.mxml container
We’ve found that the unit tests we’ve written for our C#/C++ code have really
What should i use to code Classic ASP under Linux. I have really tried
I have some really complicated legacy code I've been working on that crashes when
This is a really odd situation that I can't seem to work out where
I have a really odd error: [04-Jun-2010 15:55:32] PHP Catchable fatal error: Object of

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.