예제 #1
0
        public void Select(string constr = "")
        {
            dynamic rows = table.Select(constr);

            if (rows == null)
            {
                return;
            }

            dt.Clear();

            foreach (IDictionary <string, object> row in rows)
            {
                DataRow newRow = dt.NewRow();
                foreach (KeyValuePair <string, object> pair in row)
                {
                    newRow[pair.Key] = pair.Value;
                }

                dt.Rows.Add(newRow);
            }

            dt.AcceptChanges();
        }