Export (0) Print
Expand All

SqlDataSourceView.ParameterPrefix Property

Gets the string that is used to prefix a parameter placeholder in a parameterized SQL query.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

protected virtual string ParameterPrefix { get; }

Property Value

Type: System.String
The "@" string.

SQL queries and commands can be parameterized, in that they contain placeholders for values that are bound to the query at run time. Depending on the ADO.NET provider that is set for the SqlDataSource control, which is identified by the ProviderName property, the parameters are evaluated by alias or by their ordering in the ParameterCollection object.

If the ProviderName is not set or is set to the System.Data.SqlClient, parameters are evaluated by alias and the ParameterPrefix property is used to add a parameter prefix to the Name property of each Parameter object in a ParameterCollection during a data retrieval or data manipulation operation. If the ProviderName property is set to the System.Data.OleDb or System.Data.Odbc, the parameters are evaluated by order and the ParameterPrefix and Name properties are ignored.

If you extend the SqlDataSourceView class, you can override the ParameterPrefix property to supply a prefix other than the "@" string, if required.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft