SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running SharePoint Foundation and copying a site template per project. I would like to filter the BCS list in my template using the site name.

Is there a possible method?

share|improve this question

Yeah there is, I'm actually filtering BCS lists based upon a property in the site's propertybag, but you can really use any variable you want.

What you basically want to do is use the .NET class option for BCS. Instead of getting results directly out of SQL Server, get them via a .NET class. In the methods used, you can use your SPContext to figure out which site called the method and provide extra filtering instead. I have a brief description up on my blog here:, sorry there's no copy/paste code snippets, I can't share that code because it's rights protected. But with some tutorials on using .NET classes for BCS, you'll get there I'm sure.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.