Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Create the web service proxy
        webService = new TetrisWebServiceSoapClient();

        //Create a DataTable object and populate it with the high scores DataTable returned from the web service
        DataTable dt = webService.GetHighScores();

        //sort the data using the Score field, and arrange it in descending order - this makes the highest score appear at the top of the table
        dt.DefaultView.Sort = "Score desc";
        //assign the dataTable as the datasource to the GridView and bind - this makes the data viewable
        HighScoresGridView.DataSource = dt;
        HighScoresGridView.DataBind();
    }
Ejemplo n.º 2
0
 protected void btnGetHighScoreWs_Click(object sender, EventArgs e)
 {
     TetrisWebService.TetrisWebServiceSoapClient ws = new TetrisWebService.TetrisWebServiceSoapClient();
     DataTable dt = ws.GetHighScores();
 }