why This Error occur?Both DataSource and DataSourceID are defined on 'cboIndentNo'. Remove one definition.?

Nov 16 2009 5:09 AM

Hi,

 

Error+ Both DataSource and DataSourceID are defined on 'cboIndentNo'.  Remove one definition.?

DataTable dtIngre = new DataTable();
 dtIngre = objWebImp.GetIngredients(Convert.ToInt32(value));

 

I get the Data and showing in Data Table Visuvalizer

Field Name is like this:

Ingredient   ItemId     Qty      Units

Bajra           12       222     kgs

Rice             13      221     kgs

 

SqlDataSource ds1 = new SqlDataSource();

 

 cboIndentNo.DataSource = dtIngre;

 cboIndentNo.DataTextField = "Ingredient";

 cboIndentNo.DataValueField = "ItemId";

cboIndentNo.DataBind();//error showing like this

 

Both DataSource and DataSourceID are defined on 'cboIndentNo'.  Remove one definition.

 

Thanks


Answers (1)