I am geeting following errors.while running my project.plz respond asap its urgent!
thak u
Operator '==' cannot be applied to operands of type 'int' and 'object'
Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.DataGrid'
Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.DataGrid'
private void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "showorders")
{
if (e.Item.ItemIndex == e.CommandArgument & (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem))
{
string customerid;
customerid = ((Label)(e.Item.FindControl("Label2"))).Text;
DataGrid childgrid;
DataSet ds = GetOrdersDataSet(customerid);
childgrid = e.Item.FindControl("DataGrid1");
childgrid.DataSource = ds;
childgrid.DataBind();
childgrid.Visible = true;
((LinkButton)(e.Item.FindControl("LinkButton1"))). Text = "Hide Orders";
((LinkButton)(e.Item.FindControl("LinkButton1"))). CommandName = "hideorders";
}
else
if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)
{
DataGrid childgrid;
childgrid = e.Item.FindControl("DataGrid1");
childgrid.DataSource = null;
childgrid.Visible = false;
((LinkButton)(e.Item.FindControl("LinkButton1"))). Text = "Show Orders";
((LinkButton)(e.Item.FindControl("LinkButton1"))). CommandName = "showorders";
}
}
}