How to Use entity classes for Multiple Records ?
-
At present I am using Entity Classes for Storing Values Retrieved from DataBase . eg : I retrieved employeeName,employeeID and Salary from Database and assigned it to properties EntEmpname, EntEmpId,ENTSalary of entity class and using it on front end . Works fine for one record , My question is If I want to retrieve Multiple Records using Entity class do I have to create that many instances of Entity class or is there any other way out ?
-
At present I am using Entity Classes for Storing Values Retrieved from DataBase . eg : I retrieved employeeName,employeeID and Salary from Database and assigned it to properties EntEmpname, EntEmpId,ENTSalary of entity class and using it on front end . Works fine for one record , My question is If I want to retrieve Multiple Records using Entity class do I have to create that many instances of Entity class or is there any other way out ?
Yes, you will, by definition, need a list of the Entity class. How else could it work ?
Christian Graus Driven to the arms of OSX by Vista.
-
Yes, you will, by definition, need a list of the Entity class. How else could it work ?
Christian Graus Driven to the arms of OSX by Vista.
Hi Graus, So suppose my query returned me a 1000 records, will it be better to use a Dataset or still list of the Entity class would be better ??
-
Hi Graus, So suppose my query returned me a 1000 records, will it be better to use a Dataset or still list of the Entity class would be better ??
Nishant Singh wrote:
will it be better to use a Dataset or still list of the Entity class would be better ??
If you search this you will get plenty of discussions on this topic. IMO, you should go with custom strongly typed entity classes. Fill the entity classes with
DataReader
. Do you know aDataSet
is filled usingDataReader
? Assume your entity class name isCustomer
, you can return 1000 records keeping in aList<Customer>
. Since List(T) supports enumeration, it can be directly supplied toDataSource
of all popular controls which supports data binding.Navaneeth How to use google | Ask smart questions
-
Nishant Singh wrote:
will it be better to use a Dataset or still list of the Entity class would be better ??
If you search this you will get plenty of discussions on this topic. IMO, you should go with custom strongly typed entity classes. Fill the entity classes with
DataReader
. Do you know aDataSet
is filled usingDataReader
? Assume your entity class name isCustomer
, you can return 1000 records keeping in aList<Customer>
. Since List(T) supports enumeration, it can be directly supplied toDataSource
of all popular controls which supports data binding.Navaneeth How to use google | Ask smart questions
Thanx Navaneeth, Got your point ,