Please see the following
DataSet ds = new DataSet("AB");
ds.ReadXml(reader);
DataTable dtProperty = ds.Tables["property"];
DataTable dtvalue = ds.Tables["value"];
Table table = GeneratingTable();
property table has : prop_id,label
value table has:value,prop_id
DataRow dr;
DataRow dr2;
for (int r = 0; r < dtProperty.Rows.Count; ++r)
{
dr = dtProperty.Rows[r];
dr2 = dtvalue.Rows[r];
}
Now I want the same result by looping through values table only but not property table. something looks like
foreach(prop_id in dtvalue)
{
getpropertyname(prop_id)
}
I know the logic but finding difficulty with code. Can someone help me on this? Please
Thanks
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Francis SusaimichaelPosted Oct 15, 2015, 9:18 AM
Raghu MohanPosted Oct 15, 2015, 8:30 AM
Francis SusaimichaelPosted Oct 14, 2015, 11:46 PM
foreach(DataRow drValue in dtvalue.Rows)
{
// Get the prop_id column value
string strPropColValue = Convert.ToString(drValue["prop_id"]);
}