2 using System.Collections;
4 using System.Web.UI.WebControls;
8 public class SimplePage : System.Web.UI.Page
10 protected DataGrid testGrid;
14 this.Load += new System.EventHandler(this.Page_Load);
17 private void Page_Load(object o, EventArgs e)
19 IDataReader reader = new DummyReader ();
20 testGrid.DataSource = reader;
25 class DummyReader : IDataReader, IEnumerable {
26 IEnumerator IEnumerable.GetEnumerator ()
28 return new EnumThis ();
31 class EnumThis : IEnumerator {
32 public bool MoveNext ()
41 public object Current {
48 Console.WriteLine ("Close");
51 public DataTable GetSchemaTable ()
53 Console.WriteLine ("GetSchemaTable");
57 public bool NextResult ()
59 Console.WriteLine ("NextResult");
65 Console.WriteLine ("Read");
71 Console.WriteLine ("Depth");
76 public bool IsClosed {
78 Console.WriteLine ("IsClosed");
83 public int RecordsAffected {
85 Console.WriteLine ("RecordsAffected");
90 public void Dispose ()
92 Console.WriteLine ("Dispose");
95 public bool GetBoolean(int i)
100 public byte GetByte(int i)
104 public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferOffset, int length)
110 public char GetChar(int i)
116 public long GetChars(int i, long fieldOffset, char[] buffer, int bufferOffset, int length)
122 public IDataReader GetData(int i)
128 public string GetDataTypeName(int i)
134 public DateTime GetDateTime(int i)
136 return DateTime.MinValue;
140 public Decimal GetDecimal(int i)
146 public double GetDouble(int i)
152 public Type GetFieldType(int i)
158 public float GetFloat(int i)
164 public Guid GetGuid(int i)
170 public short GetInt16(int i)
176 public int GetInt32(int i)
182 public long GetInt64(int i)
188 public string GetName(int i)
194 public int GetOrdinal(string name)
200 public string GetString(int i)
206 public object GetValue(int i)
212 public int GetValues(object[] values)
218 public bool IsDBNull(int i)
224 public int FieldCount {
228 public object this [string name] {
232 public object this [int i] {