1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- namespace Bowin.Common.Utility
- {
- /// <summary>
- /// DataSet 的扩展
- /// </summary>
- public static class DataSetExtension
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="ds"></param>
- /// <returns></returns>
- public static IEnumerable<DataTable> AsEnumerable(this DataSet ds)
- {
- if (ds == null)
- {
- throw new ArgumentNullException("ds");
- }
- foreach (DataTable item in ds.Tables)
- {
- yield return item;
- }
- }
- }
- }
|