use*_*748 0 c# parameters casting
我有一些参数正在通过,但有一些铸造问题,我想知道什么是最好的方法来做到这一点.
ReportExecution2005.ParameterValue[] parameters
parameters[0].Label = "reportID";
parameters[0].Value = "5"; /* I want to pass a variable here not an actual string value -- I want it to be of type int. I tried to cast with no luck*/
parameters[1].Label = "ReportName";
parameters[1].Value = reportName;
parameters[2].Value = reportID.ToString;
Run Code Online (Sandbox Code Playgroud)
拿你的int变量,.ToString()最后做.这将把它变成一个字符串.你不能把inta string转换为a - 因为 - 如注释 - 它们之间没有隐式转换.