how can i call the delete store procedure in linq query
A:
I've not used LINQ, but if you can execute raw SQL, then it'd just be:
DROP PROCEDURE myStoredProcedure
inkedmn
2009-07-22 13:04:50
+1
A:
Simply add the stored procedure that does the deletion to the database and then add the stored proceduere to your .dbml. The stored procedure would then be available as a method of your datacontext.
So if you add a stored procedure called DeleteUserse to your database and .dbml you would be able to call it like this
using (SomeWebsiteDataContext db = new SomeWebsiteDataContext())
{
db.DeleteUsers();
}
cptScarlet
2009-07-22 13:09:04
A:
Scott Guthrie has a fairly detailed post on updating databases with Stored Procedures through LINQ:
LINQ to SQL (Part 7 - Updating our Database using Stored Procedures)
Zhaph - Ben Duguid
2009-07-22 13:09:15