Page 1 of 1

Understanding your WEB example?

Posted: Fri 28 Jul 2006 19:22
by davidkennedy
Alexey,
I've been following through your \Samples\Web\CS. Thank you for telling me about it.
In the code below what class contains the DataBind() method. What object is being forced to databind?
protected void btExecute_Click(object sender, System.EventArgs e) {

try {
mySqlConnection.UserId = tbUser.Text;
mySqlConnection.Password = tbPassword.Text;
mySqlConnection.Host = tbHost.Text;
mySqlConnection.Database = tbDatabase.Text;
mySqlConnection.Port = Convert.ToInt32(tbPort.Text);

mySqlCommand.CommandText = tbSQL.Text;

mySqlDataAdapter.Fill(dataSet, "Table");
dataGrid.DataSource = "Table";

DataBind();
lbResult.Visible = true;
}
catch (Exception exception) {
lbError.Text = exception.Message;
}

Posted: Mon 31 Jul 2006 07:36
by Alexey
System.Web.UI.Page class contains the DataBind() method.
WebForm object is being forced to databind.