using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.OleDb; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace placar { /// /// Summary description for roko_recordes. /// public partial class roko_recordes : System.Web.UI.Page { //e:\\home\\skullptor\\dados\\game.mdb //C://Inetpub//wwwroot//placar//dados//game.mdb;"); OleDbConnection Conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='E:\inetpub\vhosts\marciobaraldi.com.br\httpdocs\dados\game.mdb';Persist Security Info=False"); protected void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here int TotalRow, FinalRow, Indice; System.Data.DataTable recordes = new DataTable() ; recordes = Consulta("select top 50 nome, pontos from tb_placar order by pontos desc").Tables[0]; Conn.Close(); GridScore.DataSource = recordes; GridScore.DataBind(); TotalRow = Consulta("select top 50 nome, pontos from tb_placar").Tables[0].Rows.Count + 1 ; FinalRow = 1; Indice = 0; Conn.Close(); while (FinalRow < TotalRow) { GridScore.Items[Indice].Cells[0].Text = FinalRow.ToString(); ++FinalRow; ++Indice; } } public DataSet Consulta (string StrSql) { System.Data.DataSet Leitor = new System.Data.DataSet(); Leitor.Reset(); System.Data.OleDb.OleDbDataAdapter Adpt = new OleDbDataAdapter (); System.Data.OleDb.OleDbCommandBuilder Cmdb = new OleDbCommandBuilder(Adpt); try { checked { Adpt.SelectCommand = new System.Data.OleDb.OleDbCommand (StrSql,Conn); Adpt.Fill (Leitor,"tb_placar"); Conn.Close (); } } catch (System.Data.OleDb.OleDbException Ex) { Response.Write(Ex); } return Leitor; } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { } #endregion } }