A
Alexandre Jaquet
hi withe the following code I got some strange result
when the page load it's only fill one element
could anyone tell me why thx
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
this.sqlConnection1 = new SqlConnection ("server=HEWLETT-
IPODDL1\\SQLSERVEUR;Database=KEYLAB;user
id=sa;password=pwd");
this.sqlConnection1.Open ();
SqlDataReader reader;
this.sqlCommandGetLab = new SqlCommand ("SELECT
DESIGNATION_LABORATOIRE FROM laboratoire",
this.sqlConnection1);
reader = this.sqlCommandGetLab.ExecuteReader ();
reader.Read ();
this.dropDownListLab.DataSource = reader.GetString(0);
Page.DataBind();
this.sqlConnection1.Close ();
}
}
when the page load it's only fill one element
could anyone tell me why thx
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
this.sqlConnection1 = new SqlConnection ("server=HEWLETT-
IPODDL1\\SQLSERVEUR;Database=KEYLAB;user
id=sa;password=pwd");
this.sqlConnection1.Open ();
SqlDataReader reader;
this.sqlCommandGetLab = new SqlCommand ("SELECT
DESIGNATION_LABORATOIRE FROM laboratoire",
this.sqlConnection1);
reader = this.sqlCommandGetLab.ExecuteReader ();
reader.Read ();
this.dropDownListLab.DataSource = reader.GetString(0);
Page.DataBind();
this.sqlConnection1.Close ();
}
}