using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class test_vue : System.Web.UI.Page
{	
    protected void Page_Load(object sender, EventArgs e)
    {
        string c_string = ConfigurationManager.ConnectionStrings["bancaConnectionString"].ConnectionString;
		SqlConnection cx_annuaire = new SqlConnection(c_string);

		// la vue est considérée comme une table
		SqlCommand sql = new SqlCommand("select * from VueGrandsSoldes", cx_annuaire);
		
		// ouvrir
		cx_annuaire.Open();
		
		// exécuter la requête
		SqlDataReader reader = sql.ExecuteReader();

		// utiliser le databinding pour l'affichage
		GridView1.DataSource = reader;
		GridView1.DataBind();
		
		// fermer
		reader.Close();
		cx_annuaire.Close();
    }	
}
