I agree with hammdan 1980. If the query returns the result in the correct format from the beginning it significantly reduces the processing required to get the results in the format you want it. A case will work fine for this.
Here is two articles to explain how they work:
http://blog.sqlauthority.c
http://www.databasejournal
Main Topics
Browse All Topics





by: hammdan_1980Posted on 2008-05-22 at 00:36:15ID: 21621599
The best way to do this is from your sql query ,, for example
select type_id,
CASE type_id
WHEN 1 THEN 'First'
WHEN 2 THEN 'Second'
WHEN 3 THEN 'Third'
ELSE 'Other'
END
from
myTable
Otherwise you have to check the data when at databound event in gridview and change when rebdering ,, which will be much complicated and less performance solution ....