本文整理汇总了C#中System.Web.UI.WebControls.ParameterCollection.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterCollection.Remove方法的具体用法?C# ParameterCollection.Remove怎么用?C# ParameterCollection.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.ParameterCollection
的用法示例。
在下文中一共展示了ParameterCollection.Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefreshSchema
public override void RefreshSchema(bool preferSilent)
{
try
{
this.SuppressDataSourceEvents();
bool flag = false;
IServiceProvider site = this.SqlDataSource.Site;
if (!this.CanRefreshSchema)
{
if (!preferSilent)
{
UIServiceHelper.ShowError(site, System.Design.SR.GetString("SqlDataSourceDesigner_RefreshSchemaRequiresSettings"));
}
}
else
{
IDataSourceViewSchema schema = this.GetView("DefaultView").Schema;
bool flag2 = false;
if (schema == null)
{
this._forceSchemaRetrieval = true;
schema = this.GetView("DefaultView").Schema;
this._forceSchemaRetrieval = false;
flag2 = true;
}
DesignerDataConnection connection = new DesignerDataConnection(string.Empty, this.ProviderName, this.ConnectionString);
if (preferSilent)
{
flag = this.RefreshSchema(connection, this.SelectCommand, this.SqlDataSource.SelectCommandType, this.SqlDataSource.SelectParameters, true);
}
else
{
Parameter[] parameterArray = this.InferParameterNames(connection, this.SelectCommand, this.SqlDataSource.SelectCommandType);
if (parameterArray == null)
{
return;
}
ParameterCollection parameters = new ParameterCollection();
ParameterCollection parameters2 = new ParameterCollection();
foreach (ICloneable cloneable in this.SqlDataSource.SelectParameters)
{
parameters2.Add((Parameter) cloneable.Clone());
}
foreach (Parameter parameter in parameterArray)
{
if ((parameter.Direction == ParameterDirection.Input) || (parameter.Direction == ParameterDirection.InputOutput))
{
Parameter parameter2 = parameters2[parameter.Name];
if (parameter2 != null)
{
parameter.DefaultValue = parameter2.DefaultValue;
if ((parameter.DbType == DbType.Object) && (parameter.Type == TypeCode.Empty))
{
parameter.DbType = parameter2.DbType;
parameter.Type = parameter2.Type;
}
parameters2.Remove(parameter2);
}
parameters.Add(parameter);
}
}
if (parameters.Count > 0)
{
SqlDataSourceRefreshSchemaForm form = new SqlDataSourceRefreshSchemaForm(site, this, parameters);
flag = UIServiceHelper.ShowDialog(site, form) == DialogResult.OK;
}
else
{
flag = this.RefreshSchema(connection, this.SelectCommand, this.SqlDataSource.SelectCommandType, parameters, false);
}
}
if (flag)
{
IDataSourceViewSchema schema2 = this.GetView("DefaultView").Schema;
if (flag2 && DataSourceDesigner.ViewSchemasEquivalent(schema, schema2))
{
this.OnDataSourceChanged(EventArgs.Empty);
}
else if (!DataSourceDesigner.ViewSchemasEquivalent(schema, schema2))
{
this.OnSchemaRefreshed(EventArgs.Empty);
}
}
}
}
finally
{
this.ResumeDataSourceEvents();
}
}