VB.NET error : specified cast is not valid

  • Thread starter Thread starter Omavlana
  • Start date Start date
O

Omavlana

Hi, I am getting the above error "specified cast is not valid" while
sending the parameter to crystal report through VB.NET.

Here is my code..

'***********

Dim paramFields As New ParameterFields
Dim paramField As New ParameterField
Dim discreteVal As New ParameterDiscreteValue


paramField.ParameterFieldName = "Batch Number"

' Set the first discrete value and pass it to the parameter
discreteVal.Value = "123"

paramField.CurrentValues.Add(discreteVal)

paramFields.Add(paramField)

' Set the parameter fields collection into the viewer control.
CrystalReportViewer1.ParameterFieldInfo = paramFields


CrystalReportViewer1.ReportSource = "C:\TEMP\RpOuterJoin.rpt"

'***********

When tested in debug mode,

"paramField.ParameterFieldName" didn't get value "Batch Number"

It has shown,
<error: an exception of type: {System.ArgumentException} occured>



Pls help...

Regards,
Omav
 
Back
Top