473,396 Members | 1,785 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,396 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 1476
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.