471,330 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

LINQ to SQL

I am working my way through ScottGu's LINQ to SQL tutorials
(http://weblogs.asp.net/scottgu/archi...inq-to-sql-par
t-1.aspx), but am having problems with inserting and deleting data (3 :
Insert a New Category and Two New Products into the Database) and (4 :
Delete Products from the Database).

Are the RemoveAll and Add methods now out of date? And if so, what has
replaced them?

*** Sent via Developersdex http://www.developersdex.com ***
Sep 9 '08 #1
7 1410
On Sep 9, 11:36*am, Mike P <mike.p...@gmail.comwrote:
I am working my way through ScottGu's LINQ to SQL tutorials
(http://weblogs.asp.net/scottgu/archi...inq-to-sql-par
t-1.aspx), but am having problems with inserting and deleting data (3 :
Insert a New Category and Two New Products into the Database) and (4 :
Delete Products from the Database).

Are the RemoveAll and Add methods now out of date? *And if so, what has
replaced them?
Looking that docs for Table<TEntity(http://msdn.microsoft.com/en-us/
library/bb336216.aspx) I suspect you want DeleteAllOnSubmit and
InsertOnSubmit.

Jon
Sep 9 '08 #2
Excellent...thanks Jon!

*** Sent via Developersdex http://www.developersdex.com ***
Sep 9 '08 #3
On the same tutorial, how do you call a stored proc in a LINQ data
context? The example on the tutorial doesn't work either
(http://weblogs.asp.net/scottgu/archi...inq-to-sql-par
t-1.aspx - 5) Call a stored procedure)

*** Sent via Developersdex http://www.developersdex.com ***
Sep 9 '08 #4
On Sep 9, 12:54*pm, Mike P <mike.p...@gmail.comwrote:
On the same tutorial, how do you call a stored proc in a LINQ data
context? *The example on the tutorial doesn't work either
(http://weblogs.asp.net/scottgu/archi...inq-to-sql-par
t-1.aspx - 5) Call a stored procedure)
I haven't done it myself, but it's probably worth looking for examples
written in 2008, i.e. after LINQ to SQL was actually released. Even
some books were published (or at least finished) before the product
was released, which is always a problem.

Jon
Sep 9 '08 #5
Re the SPROC - that looks about right... have you dragged the SP onto
the data-context's designer surface?

What are you seeing? Does it simply not appear? Or not work?

Marc
Sep 9 '08 #6
If you mean the type is wrong - to bind an SPROC to an entity type,
you need to either drop it onto the left-hand entity, or fix the type
after the event (unless it is a trivial SP that SQLMetal can
understand - not sure if it ever bothers, though).

Marc
Sep 9 '08 #7
Got it working by dragging and dropping the stored proc...thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Sep 9 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Dave Johnson | last post: by
9 posts views Thread by =?Utf-8?B?cmF1bGF2aQ==?= | last post: by
reply views Thread by =?Utf-8?B?SHlwZXJjb2Rlcg==?= | last post: by
4 posts views Thread by =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post: by
14 posts views Thread by thj | last post: by
9 posts views Thread by Cirene | last post: by
3 posts views Thread by =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post: by
4 posts views Thread by George | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.