CS文件的绑定 代码如下: string indexTopMainStr = "select top 9 id,title from Table order by ID desc"; SqlDataAdapter rst = new SqlDataAdapter(indexTopMainStr,conn); conn.Open(); DataSet rdt = new DataSet(); rst.Fill(rdt); IndexTopMain.DataSource = rdt;//数据绑定 IndexTopMain.DataBind(); conn.Close();