Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
abstract AutoGenerateWhereClause : bool with get, set override AutoGenerateWhereClause : bool with get, set
Property ValueType: System.Boolean
true if the LinqDataSource control will create the Where clause; otherwise, false. The default is false.
When you set the property to true, the LinqDataSource control dynamically creates the Where clause from the parameters in the WhereParameters collection. Each parameter that you add to the WhereParameters collection must have its Name property set to a value that matches a property in the data object that is being queried. The automatically generated Where clause will check whether the value specified in the WhereParameters collection equals the value of the matching property in the data object. If you provide more than one parameter, the parameters are linked with a logical AND operation. Parameters that contain a null reference (Nothing in Visual Basic) or an empty value are not included in the Where clause.
The automatically generated Where clause can test only for equality and can link parameters only with the AND operation. Do not set the property to true if you have to add a condition that does not test for equality or if you have to relate parameters with the OR operation. You can accomplish these tasks by setting the property to false and adding placeholders in the Where property for each parameter in the WhereParameters collection. In the Where property, preface each placeholder name with the @ symbol.
You do not set the Where property when the property is true, because the parser dynamically creates the Where clause. The LinqDataSource control throws an exception if the property is true and the Where property is assigned values.
The following example shows a LinqDataSource control with the set to true. A GridView control is bound to the LinqDataSource control to display the data that is returned from the query. A DropDownList control is included that is populated with three values. A parameter is included in the WhereParameters collection with the name set to Category, which matches one of the properties of the data object. Its ControlID property is set to the ID of the DropDownList control. The LinqDataSource control automatically creates the Where property to filter records based on the value that the user selects from the DropDownList control. The query returns the records whose Category property matches the value that the user has selected from the DropDownList control.
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.