I know that(Include) boss.Thats ok for get constraint table values.I want delete forign key constraint table values.Do you understand ?
Right....No need to tell what you know(should have specified earlier)....you post question to
"know"......people here dont have idea about what you have tried....
The way you put questions is the only way to know how can answer...
I know that(Include) boss.Thats ok for get constraint table values.I want delete forign key constraint table values.Do you understand ?
Right....No need to tell what you know(should have specified earlier)....you post question to
"know"......people here dont have idea about what you have tried....
The way you put questions is the only way to know how can answer...
vickyasp.net
Member
570 Points
423 Posts
Re: Delete Issue
Nov 21, 2012 10:51 AM|LINK
Use Delete Script By CodeBehind to Set Condition
Vignesh
RameshRajend...
Star
7983 Points
2099 Posts
Re: Delete Issue
Nov 21, 2012 10:55 AM|LINK
What you mean?
Give me any sample code?or url?
me_ritz
Star
9337 Points
1447 Posts
Re: Delete Issue
Nov 21, 2012 11:05 AM|LINK
Right....No need to tell what you know(should have specified earlier)....you post question to "know"......people here dont have idea about what you have tried....
The way you put questions is the only way to know how can answer...
BTW....possible options are - http://www.codeproject.com/Articles/27577/Cascading-Deletes-in-LINQ-to-SQL
RameshRajend...
Star
7983 Points
2099 Posts
Re: Delete Issue
Nov 21, 2012 11:17 AM|LINK
Hey i have already tried u r link http://www.codeproject.com/Articles/27577/Cascading-Deletes-in-LINQ-to-SQL
But that was cascade delete set manualy set DataBase.But my question is how to set cascade delete threw linq query?.....
me_ritz
Star
9337 Points
1447 Posts
Re: Delete Issue
Nov 21, 2012 11:22 AM|LINK
That is not the role of LINQ in your architecture....You should do that in DB prior to deploying the new data model.
RameshRajend...
Star
7983 Points
2099 Posts
Re: Delete Issue
Nov 21, 2012 11:27 AM|LINK
Ok
Leave it.
Any way its code was working good..
public void DeleteJobPosting(int id) { JobPosting jobPosting = datamodel.JobPostings.FirstOrDefault(a => a.Id == id); datamodel.Addresses.DeleteOnSubmit(jobPosting.Addresses.FirstOrDefault()); datamodel.ContactedCandidates.DeleteAllOnSubmit(jobPosting.ContactedCandidates); datamodel.AppliedJobs.DeleteAllOnSubmit(jobPosting.AppliedJobs); datamodel.JobPostings.DeleteOnSubmit(jobPosting); datamodel.SubmitChanges(); }Thank you..