Linq to SQL Add method missing

Last Post 16 Dec 2008 07:51 AM by bryanmurtha. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
bryanmurtha
New Member
New Member

--
16 Dec 2008 07:51 AM
I have a table defined as the following:

CREATE TABLE [dbo].[VidGalleryData]
(
[VideoID] [varchar](10) NOT NULL,
[ListingID] [varchar](10) NOT NULL,
[WmUserID] [varchar](30) NULL,
[HeadLine] [varchar](100) NULL,
[Description] [varchar](200) NULL,
[Categories] [varchar](100) NULL,
[Keywords] [varchar](100) NULL,
CONSTRAINT [PK_VidGalleryData] PRIMARY KEY CLUSTERED
([VideoID])
)

Then I added the LINQ to SQL Classes to my Console project. I had an IEnumerable<Listing> built out of xml data that I wanted to add to the database. When I try to do the following to just add a record to the above table:
foreach (Listing listing in Videos)
{
videoData.VideoID = listing.VideoID;
videoData.ListingID = listing.ListingID;
videoData.WmUserID = listing.WmUserID;
videoData.HeadLine = listing.HeadLine;
videoData.Description = listing.Description;
videoData.Keywords = listing.Keywords;
videoData.Categories = listing.Categories;
try
{
// Save the changes.
feed.SubmitChanges();
}
// Detect concurrency conflicts.
catch (ChangeConflictException)
{
// Resolve conflicts.
feed.ChangeConflicts.ResolveAll(RefreshMode.KeepChanges);
}
}

It will run without error but no records are added to that table?

Any help appreciated.


You are not authorized to post a reply.

Acceptable Use Policy