Gets or sets the name of the class that the ObjectDataSource object represents.
Assembly: System.Web (in System.Web.dll)
To create an instance of the object that the ObjectDataSource control binds to, the control uses reflection to load the type that is identified by the type name at run time. Therefore, the value of the property can be a partially qualified type for code that is located in the Bin or App_Code directories or a fully qualified type name for code that is registered in the global assembly cache. If you use the global assembly cache, you must add the appropriate reference to the assemblies section of the Machine.config or Web.config file.
The type must have a default constructor, unless you handle the ObjectCreating event to create an instance of it yourself. An instance of the type is created for each call to the Select, Update, Insert, and Delete methods, if the methods on the type are member methods. An instance is not created if the methods are static (Shared in Visual Basic). If the type implements the IDisposable interface, the Dispose method is called before the object is destroyed.
The following code example demonstrates how a GridView control can display data by using an ObjectDataSource control on a Web Forms page. The ObjectDataSource identifies a partially or fully qualified class name with its property and a method that is called to retrieve data with its SelectMethod property. At run time, the object is created and the method is called using reflection. The GridView control enumerates through the IEnumerable collection that is returned by the SelectMethod property, and displays the data.
The following example shows the class that the property value refers to.