
  
  public partial class CreateDataTable : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          	//取Book表的前3条记录到DataReader中
      string connStr = "server=(local);uid=sa;pwd=123;database=demo";
  	SqlConnection conn = new SqlConnection(connStr);
  	conn.Open ();
  	SqlCommand cmd = new SqlCommand ("select top 3 BookName,Description from Books",conn);
  	【SqlDataReader】 reader = cmd.ExecuteReader ();
  
  	//创建内存表DataTable
  	DataTable table = new 【DataTable】("Employees");
  	table.【Columns】.Add("Index");//增加Index列
  	【table】.Columns.Add("BookName");//增加BookName列
  	table.Columns.【Add】("Description");//增加Description列
  
  	//把DataReader中的数据赋给内存表DataTable
  	int index = 1;
  	while(reader.【Read】())
  	{
  		DataRow row = table.【NewRow】();
  		row["Index"] = 【index】.ToString();
  		row["BookName"] = reader["BookName"].ToString();
  		row["Description"] = 【reader】["Description"].ToString();
  		table.Rows.【Add】(row);
  		index=index+1;
  	}
  	【reader】.Close();
  	conn.Close ();
  	//在GridView中绑定显示内存表DataTable的数据
  	GridView1.【DataSource】 = table;
  	GridView1.【DataBind】();	
  
  } 
      }
  

--答案--
   SqlDataReader   DataTable   NewRow   Columns   table   DataSource   index   reader   reader   DataBind