| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- using System.Collections;
- namespace Core.LgMes.Client.LgDeviceManager
- {
- class HelpClass
- {
- public DataSet CreateDataSet(DataTable alist)
- {
- DataSet ds = new DataSet();
- ds.Tables.Add(alist);
- return ds;
- //DataSet Createds = new DataSet();
- //DataTable dt = new DataTable();
- //int numString = 0;
- //if (alist != null)
- //{
- // foreach (Hashtable colum in alist)//构建列
- // {
- // numString++;
- // if (numString > 1)
- // {
- // break;
- // }
- // else
- // {
- // foreach (DictionaryEntry colName in colum)
- // {
- // dt.Columns.Add(colName.Key.ToString());
- // }
- // }
- // }
- // string name = "";
- // foreach (Hashtable list in alist)//构建行
- // {
- // DataRow row = dt.NewRow();
- // foreach (DictionaryEntry hs in list)
- // {
- // name = hs.Key.ToString();
- // row[name] = hs.Value;
- // }
- // dt.Rows.Add(row);
- // }
- // Createds.Tables.Add(dt);
- // return Createds;
- //}
- //else
- //{
- // return null;
- //}
- }
- }
- }
|