Tuesday, 14 June 2016

Converting Asp ObjectDataSource into List

It's very easy to convert the  ObjectDataSource into a List, The ObjectDataSource don't have datasource property instead of that we will use select property to get the datasource values.

Example C# code given Below.

List<DeploymentEntity> codes = (List<DeploymentEntity>)DeploymentsDS.Select;

Example VB code given Below.


  Dim codes As List(Of DeploymentEntity) = DirectCast(DeploymentsDS.Select, List(Of DeploymentEntity))