LINQ in Action roller

LINQ to SQL: Inserting new objects with stored procedures

Another adventure in LINQ land... Have a table Test (TestID int NOT NULL IDENTITY, Name varchar(50)) and a Test class created with the designer. Trying to insert a new object with a stored procedure. The problem is how to get the TestID field populated (Name field works fine) on a test object. Code Snippet ALTER PROCEDURE dbo.AddTest ( @name varchar (50) ) AS INSERT INTO dbo.Test ( Name ) VALUES (@name) RETURN SCOPE_IDENTITY() This adds the row to the database, but leaves the TestID field 0 on the Read More...
Published Tuesday, May 29, 2007 8:44 AM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication