Gets or sets the name of the property or field in the data context class that represents a data collection.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Set theproperty to the name of the property or field that represents the data that you want to retrieve. When you are connecting to a database table, the name of the property is usually the same as the name of the table. When you are connecting to an in-memory data collection, set the property to the name of the property or field that returns the data collection.
To enable automatic update, insert, or delete operations, the class that is assigned to the ContextTypeName property must derive from DataContext and the property that is assigned to the property must derive from Table<'TEntity>.
For information about how to select data from an instance of a class, see the Result property.
The following example shows two LinqDataSource controls. In one LinqDataSource control, the property is set to a property in a class. That property returns an array of strings. In the other LinqDataSource control, the property is set to a property that represents a database table.
The class named ExampleDataContext that represents the database table is not shown in this example. For this example to work, you must create this class by adding a LINQ to SQL class named Example.dbml and dragging a table named Movie onto the O/R Designer. A class named ExampleDataContext with a property named Movies is generated.
The following example shows the class named MovieLibrary that is referenced in the LinqDataSource control.
Available since 3.5