接到字符串转化成datatable

2019-04-15 15:33发布

public DataTable GetPicLst(string strImglst)
    {         DataTable dt = new DataTable();
        dt.Columns.Add("pic", Type.GetType("System.String"));
        if (!String.IsNullOrEmpty(strImglst))
        {
            string[] temp = strImglst.Split(';');
            for (int i = 0; i < temp.Length; i++)
            {
                dt.Rows.Add(new object[] { temp[i].ToString() });
            }
        }
        return dt;
    }