Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7182253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:43:51+00:00 2026-05-28T17:43:51+00:00

I am trying to build on the WebSharingAppDemo-SqlProviderEndToEnd msdn sample application to build out

  • 0

I am trying to build on the “WebSharingAppDemo-SqlProviderEndToEnd” msdn sample application to build out a custom MSF implementation. As part of that I added parameterized filters to the provisioning. I have been referencing http://jtabadero.wordpress.com/2010/09/02/sync-framework-provisioning/ for some idea of how to do this. Now that I have that in place, when I re-initialize the “peer1” database and try to provision it initially I now get an error:

Scopes not created from a template cannot have FilterParameters.
Parameter ‘@my_param_name’ was found on Table ‘[my_table_name]’.
Please ensure that no FilterParameters are being defined on a scope
that is not created from a template.

The only guess I have as to what a “template” is, is the provisioning templates that the Sync Toolkit’s tools can work with, but I don’t think that applies in the scenario I’m working with.

I have been unable to find anything that would indicate what I should do to fix this. So how can I get past this error but still provision my database with parameterized filters?

The below code is what I’m using to build the filtering into the provisioning (SqlSyncScopeProvisioning) object.

private void AddFiltersToProvisioning(IEnumerable<TableInfo> tables)
{
    IEnumerable<FilterColumn> filters = this.GetFilterColumnInfo();
    foreach (TableInfo tblInfo in tables)
    {
        this.AddFiltersForTable(tblInfo, filters);
    }
}

private void AddFiltersForTable(TableInfo tblInfo, IEnumerable<FilterColumn> filters)
{
    IEnumerable<FilterColumn> tblFilters;
    tblFilters = filters.Where(x => x.FilterLevelID == tblInfo.FilterLevelID);
    if (tblFilters != null && tblFilters.Count() > 0)
    {
        var tblDef = this.GetTableColumns(tblInfo.TableName);
        StringBuilder filterClause = new StringBuilder();
        foreach (FilterColumn column in tblFilters)
        {
            this.AddColumnFilter(tblDef, column.ColumnName, filterClause);
        }

        this.Provisioning.Tables[tblInfo.TableName].FilterClause = filterClause.ToString();
    }
}

private void AddColumnFilter(IEnumerable<TableColumnInfo> tblDef, string columnName, StringBuilder filterClause)
{
    TableColumnInfo columnInfo;
    columnInfo = tblDef.FirstOrDefault(x => x.ColumnName.Equals(columnName, StringComparison.CurrentCultureIgnoreCase));
    if (columnInfo != null)
    {
        this.FlagColumnForFiltering(columnInfo.TableName, columnInfo.ColumnName);
        this.BuildFilterClause(filterClause, columnInfo.ColumnName);
        this.AddParamter(columnInfo);
    }
}

private void FlagColumnForFiltering(string tableName, string columnName)
{
    this.Provisioning.Tables[tableName].AddFilterColumn(columnName);
}

private void BuildFilterClause(StringBuilder filterClause, string columnName)
{
    if (filterClause.Length > 0)
    {
        filterClause.Append(" AND ");
    }

    filterClause.AppendFormat("[base].[{0}] = @{0}", columnName);
}

private void AddParamter(TableColumnInfo columnInfo)
{
    SqlParameter parameter = new SqlParameter("@" + columnInfo.ColumnName, columnInfo.GetSqlDataType());
    if (columnInfo.DataTypeLength > 0)
    {
        parameter.Size = columnInfo.DataTypeLength;
    }

    this.Provisioning.Tables[columnInfo.TableName].FilterParameters.Add(parameter);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:43:53+00:00Added an answer on May 28, 2026 at 5:43 pm

    i guess the error is self-explanatory.

    the FilterParameters can only be set if the scope inherits from a filter template. you cannot set the FilterParameters for a normal scope, only FilterClause.

    Using parameter-based filters is a two step process: Defining the filter/scope template and creating a scope based on a template.

    I suggest you re-read the blog entry again and jump to the section Parameter-based Filters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to build a application or a method that goes through all of
I trying to build an application that is using the torrent technology to make
I'm trying build an App Engine connected Android application and am having some problems
Trying to build a GUI application in Java/Swing. I'm mainly used to painting GUIs
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
I am trying build small webcam chat (web application). I searched on google and
I'm trying build a regex that will replace any characters not of the format:
Trying to build a plugin effect that will some what look better than this
Trying to build a micro-CMS (of sorts), which needs to dish out content i.e.
I`m trying to build a application using the Fragment/Tabs and Pager from the android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.