我需要哪个命名空间来使我的扩展程序工作?
这是我的扩展方法
using System; using System.Collections.Generic; using System.Web; using System.Data; namespace MyUtilities { public static class DataReaderExtensions { public static DataTable ToDataTable(IDataReader reader) { DataTable table = new DataTable(); table.Load(reader); return table; } } }
当我试图这样使用它时
Session["Master"] = cust.GetCustomerOrderSummary((string)Session["CustomerNumber"]).ToDataTable();
它无法工作。这是 .net 2.0。