H
Hari
Hi,
I am using a GridView and a combo box for displaying a list of
companies and upon selection the list in GridView will change. For this
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == true)
{
SqlDataSource2.SelectCommand = "SELECT * FROM [contract]
WHERE [cust_id] = " + cmbCompany.Text;
}
}
protected void cmbCompany_SelectedIndexChanged(object sender,
EventArgs e)
{
SqlDataSource2.SelectCommand = "SELECT * FROM [contract] WHERE
[cust_id] = " + cmbCompany.Text;
}
Only the second method works. Why? Any Idea?.
I am using a GridView and a combo box for displaying a list of
companies and upon selection the list in GridView will change. For this
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == true)
{
SqlDataSource2.SelectCommand = "SELECT * FROM [contract]
WHERE [cust_id] = " + cmbCompany.Text;
}
}
protected void cmbCompany_SelectedIndexChanged(object sender,
EventArgs e)
{
SqlDataSource2.SelectCommand = "SELECT * FROM [contract] WHERE
[cust_id] = " + cmbCompany.Text;
}
Only the second method works. Why? Any Idea?.