473,216 Members | 1,363 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 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 1471
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave Johnson | last post by:
Greetings, i want to be able to use linq new technology with sql server. the senario i am not able to do so far is as follow: 1- i program with linq 2- be able to generate and manipulate...
4
by: cj | last post by:
Can I use LINQ in VB .Net 2008 to get to a Visual FoxPro Table? I've seen demos of it with SQL Server but they've used it with a server browser and I don't think that'd work when I need to see VFP...
9
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how...
0
by: =?Utf-8?B?SHlwZXJjb2Rlcg==?= | last post by:
I'm encountering some strange behavior after deploying a ASP.net 3.5 website to production, i'm unable to reproduce these in my dev environment. This error seems to occur very randomly but it's...
4
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and...
14
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
9
by: Cirene | last post by:
I'm about to begin a brand new, big, ASP.NET project (using 3.5 .net fw), VS 2008. I'm using MySQL as the backend (customer request.) I have absolutely no experience with LINQ and/or the Entity...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
4
by: George | last post by:
I am a bit conservative type and usually give some time for technology to mature before starting to try it. Today my question is Linq. To start using it or not. So here is the voting questions....
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.