views:

177

answers:

1

Ok the thing is that I am using asp.net mvc with linq to sql. I have a scenario where there are two tables group and features with many to many relationship with the third table groupfeatures. I have drag and drop all three table in the dbml file.

The thing is that it runs fine with group but when I call the Feature things the above error occured and the compilers stops at this line in ((())).

public partial class EgovtDataContext : System.Data.Linq.DataContext
{

    private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertGroup(Group instance);
    partial void UpdateGroup(Group instance);
    partial void DeleteGroup(Group instance);
    partial void InsertFeature(Feature instance);
    partial void UpdateFeature(Feature instance);
    partial void DeleteFeature(Feature instance);
    partial void InsertGroupFeature(GroupFeature instance);
    partial void UpdateGroupFeature(GroupFeature instance);
    partial void DeleteGroupFeature(GroupFeature instance);
    #endregion

    (((public EgovtDataContext() : 
           base(global::System.Configuration.ConfigurationManager.ConnectionStrings["egovtsConnectionString"].ConnectionString, mappingSource))))

The code in both the controller Group and features file is ditto copied. Note the group things are working, the features things are not.

FeaturesRepository.cs

 public IQueryable<Feature> FindAllFeatures()
 {
     return db.Features;
 }

FeaturesController.cs

  FeaturesRepository FeatureRepository = new FeaturesRepository();
  public ActionResult Index()
  {
      var Feature = FeatureRepository.FindAllFeatures();

      return View(Feature);
  }

So what could be wrong?

A: 

StackOverflowException usually means you've ended up in an infinite recursive loop. If I were in your shoes I'd be looking for where it'd be possible for one of your methods or properties to call itself (or call another method chain which loops back to itself).

Justin Grant
Well I have complemented you in the first line , as a advice I am deleting the answer(sorry) Well I hope I don't stop seeing more of you
mazhar kaunain baig