public bool DeleteLoc(int Location_Id)
{
DataClassesLocationDataContext dc = new DataClassesLocationDataContext();
Location loc = dc.Locations.Single(u => u.Location_id == Location_Id);
dc.Locations.DeleteOnSubmit(loc);
dc.SubmitChanges();
return true;
}
public bool DeleteComp(int Company_Id)
{
DataClassesLocationDataContext dc = new DataClassesLocationDataContext();
**Company com = dc.Comp.Single(u => u.Location_id == Location_Id);**
}
In this line it does not show like as Locations in previous code
why it can not show
you are using
linq to sqlthan its must be name of the class that you can see in you DBML file generated by Visual Studio…if i m getting you correctly
here in this line Locations is set of collection contains location object.
in this line same as locations Comp is set of collection contains company object. is it cannt same as location object…So in second case it will display property of Company object not of location object.