Hi there,
Do you keep your data in Database, XML file, or ???
If you keep them in Database, than you can #1 retrieve the highest 10 by using the following query:
select top(10) numbers from DatabaseTable order by numbers desc
Than, why not just using the GridView control from VS.NET ? Add this Control:
DO THE FOLLOWING IN YOUR ASPX PAGE
<asp:GridView ID="GridView1" runat="server" DataSourceID="sqlDataSource1">
</asp:GridView>
than add SqlDataSource:
<asp:SqlDataSource ID="sqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:yourConnectionString %>"
SelectCommand="select top(10) numbers from DatabaseTable order by id desc"></asp:SqlDataSource>
At the end just replace your Connection string (String which will connect your application to the Database).
You can store your connection string in the Web.config file (if you don't have Web.config, create in your Web application Project)
And in the web config, add the following code (replace your strings appropriately)
<connectionStrings>
<add name="yourConnectionString" connectionString="Data Source=HAJAN\SQLEXPRESS;Initial Catalog=DatabaseName;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
Replace: (change the bolded replacing them with your information (your database, your database connection)
name: yourConnectioStringName
connectionString="DataSource = YOURNAME\SQLEXPRESS (database connection)
Initial Catalog=DatabaseName
IntegratedSecurity = True
providerName = "System.Data.SqlClient"
If you have any problem or further question or... something else..
Feel free to reply ;)
Cheers,
Hajan