C#技术百科
问问你的心你有没有信心 做事情要专一坚定,执着
 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  王德田  阅读(197)  评论(0编辑  收藏  举报