Click here to Skip to main content
15,886,037 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
private void Wash_Iron_Load(object sender, EventArgs e)
{
obj = new WashManagement.WashIron(Constant.laundry_db);
LoadCategory(cmbitem1);
}
 
private void LoadCategory(ComboBox CboCategory)
{
IDataReader drCategory;
drCategory = obj.GetCategoryName();
while (drCategory.Read())
{
CboCategory.Items.Add(new ListItem(drCategory["product_category_name"].ToString(), drCategory["product_category_no"].ToString())); //---------> ERROR MESSAGE
 
 
}
 
public IDataReader GetCategoryName()
{
try
{
DbCommand com = db.GetStoredProcCommand(USP_Get_Category);
return db.ExecuteReader(com);
}
catch (Exception)
{
throw;
}
}
 
//GET PRODUCT CATEGORY
private const string USP_Get_Category = "USP_Get_Category";


ERROR MESSAGE
----------------

system.window.documents.listitem does not contain a constructor that takes 2 arguments
Posted
Updated 26-Mar-13 23:10pm
v2
Comments
[no name] 27-Mar-13 7:15am    
The error message and resolution are obvious so what is the question?

1 solution

Look at the error message:
system.window.documents.listitem does not contain a constructor that takes 2 arguments

It doesn't: http://msdn.microsoft.com/en-us/library/system.windows.documents.listitem.listitem%28v=vs.85%29.aspx[^]

The System.Web.UI.WebControls.ListItem does:
http://msdn.microsoft.com/en-GB/library/system.web.ui.webcontrols.listitem.aspx[^]

I suspect you have a using statement for system.window.documents which either you do not need, or which means you need to fully qualify your ListItem when you construct it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900