Click here to Skip to main content
15,791,846 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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'.
Updated 7-Oct-15 21:27pm

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
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