本文整理汇总了C#中DataProvider.FormatParameterNameForSQL方法的典型用法代码示例。如果您正苦于以下问题:C# DataProvider.FormatParameterNameForSQL方法的具体用法?C# DataProvider.FormatParameterNameForSQL怎么用?C# DataProvider.FormatParameterNameForSQL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataProvider
的用法示例。
在下文中一共展示了DataProvider.FormatParameterNameForSQL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildMappedElementCommand
/// <summary>
/// Selects the elements from the mapped table which are also in the filtered foreign query
///
/// </summary>
/// <param name="provider">the provider</param>
/// <param name="cmd">The command to which the select from the mapped table will be appended</param>
protected virtual void BuildMappedElementCommand(DataProvider provider, QueryCommand cmd)
{
string userFilter = String.Empty;
string idParam = provider.FormatParameterNameForSQL("id");
if (!String.IsNullOrEmpty(ForeignWhere))
{
userFilter +=
String.Format("INNER JOIN {0} ON {0}.{1}={2}.{1} WHERE {2}.{3}={4} AND {5}", ForeignTableName, ForeignValueColumnName, MapTableName, MapTableFkToPrimaryTable,
idParam, ForeignWhere);
}
else
userFilter += String.Format("WHERE {0}={1}", MapTableFkToPrimaryTable, idParam);
cmd.CommandSql += String.Format("SELECT {1}.{0} FROM {1} {2}", MapTableFkToForeignTable, MapTableName, userFilter);
cmd.Parameters.Add(idParam, PrimaryKeyValue, DataService.GetSchema(PrimaryTableName, ProviderName).PrimaryKey.DataType);
}