Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
IEnumerable<aclist> objList = GetACCenterList(1, cbAccCentre.SelectedValue.ToString(), "A",Convert.ToInt32(((CurList)(cbCur.SelectedValue)).CurCode), 523, strACBXml);



GetACCenterList: It is a service


Error: Unable to cast object of type 'System.Int32' to type 'FAS_Printing.GeneralSelectService.CurList'.
Posted
Updated 7-Oct-15 20:27pm
v2

1 solution

If you method GetACCenter expects a list as a parameter and you are passing it an integer (1,Convert.ToInt32(((CurList)(cbCur.SelectedValue)).CurCode) or 523), you will get an error.

Check the types of the parameters in the method.
 
Share this answer
 
v2
Comments
Sathish km 8-Oct-15 1:54am    
Convert.ToInt32(((CurList)(cbCur.SelectedValue)).CurCode) => int parameter only

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