A
ApeX
Hi guys, i hace a question
i have a datagrid
col1 col2
-----------------
D text0
text1
text2
D text3
D text4
i need to do a foreach and everywhere where's a "D" in col1 to add the
value of col2 into a string, so the final string would be "text0" +
"," + "text3" + "," + "text4";
for example:
string Uvjet()
{
foreach (DataRow red in dt.Rows)
{
if (red["col1"].ToString() == "D")
{
string uvjet = red["col2"].ToString() + ",";
}
}
return uvjet;
}
...only this fills the string "uvjet" only with one value....and i want
it to be finally filled with all necessary values, like:
"text0" + "," + "text3" + "," + "text4"
if you have any ideas, please help...
THANX!
i have a datagrid
col1 col2
-----------------
D text0
text1
text2
D text3
D text4
i need to do a foreach and everywhere where's a "D" in col1 to add the
value of col2 into a string, so the final string would be "text0" +
"," + "text3" + "," + "text4";
for example:
string Uvjet()
{
foreach (DataRow red in dt.Rows)
{
if (red["col1"].ToString() == "D")
{
string uvjet = red["col2"].ToString() + ",";
}
}
return uvjet;
}
...only this fills the string "uvjet" only with one value....and i want
it to be finally filled with all necessary values, like:
"text0" + "," + "text3" + "," + "text4"
if you have any ideas, please help...
THANX!