public string GetReturnString(DataTable tempDT, int tempColumn)
{
string tempStr = "";
if (!object.Equals(tempDT, null))
{
if (tempDT.Rows.Count > 0)
{
for (int i = 0; i < tempDT.Rows.Count; i++)
{
if (tempColumn > tempDT.Columns.Count)
tempColumn = tempDT.Columns.Count;
for (int c = 0; c <tempColumn ;c++ )
{
tempStr += Common.StringOperator.GetRightString(tempDT.Rows[i][c]) + ",";
}
tempStr = tempStr.TrimEnd(',');
tempStr += "~$~";
}
}
else
{
tempStr = "null";
}
}
else
{
tempStr = "null";
}
return tempStr;
}
posted on 2011-01-25 09:38
sanmao 阅读(208)
评论(0) 编辑 收藏