VB.NET error : specified cast is not valid

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top