Hi All ,
I have a datarow in which one of the column values having following structure :
ColName- Value
ColumnA - HYD , DEL , BLR
Now i want to modify the datarow by iterating each and every code like HYD , DEL and so on
annd i want to replace the value like the following way
ColName- Value
ColumnA - Hyderabad , Delhi , Bangalore .
Please suggest me .
Loading

Jignesh TrivediPosted Aug 10, 2012, 4:14 AM
same thing you can done here which posted earlyer
Create look up (dictionary) of code and name from dictionary you may get name.
//Create look up
Dictionary dic = new Dictionary();
dic.Add("HYD", "Hyderabad");
dic.Add("DEL", "Delhi");
dic.Add("BLR", "Bangalore");
DataRow dr = new DataRow();// Actual Data Row
string datarowValue = "";
var allValue = dr["ColumnA"].ToString().Split(new char[] { ',' });
foreach (var value in allValue)
{
if (datarowValue == "")
datarowValue = dic[value];
else
datarowValue = datarowValue + "," + dic[value];
}
dr["ColumnA"] = datarowValue;
hope this will help you.
Santhosh Kumar NallavelliPosted Aug 10, 2012, 9:06 AM