本文介绍了无法将类型为“System.Int32”的对象强制转换为类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
IEnumerable<aclist> objList = GetACCenterList(1, cbAccCentre.SelectedValue.ToString(), "A",Convert.ToInt32(((CurList)(cbCur.SelectedValue)).CurCode), 523, strACBXml);
GetACCenterList:这是一项服务 错误:无法将类型为'System.Int32'的对象强制转换为'FAS_Printing.GeneralSelectService.CurList'。
GetACCenterList: It is a service Error: Unable to cast object of type 'System.Int32' to type 'FAS_Printing.GeneralSelectService.CurList'.
推荐答案如果你的方法 GetACCenter 期望一个列表作为参数,你传递一个整数( 1 , Convert.ToInt32(((CurList)(cbCur.SelectedValue))。CurCode )或 523 ),你会得到一个错误。 检查方法中参数的类型。 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.
更多推荐
无法将类型为“System.Int32”的对象强制转换为类型
发布评论