I'm still struggling to get this code sample to work. I've downloaded code from the site in both C# and
VB.Net and neither work. Does any body know if this code should work with SQL Server 2005 Express Advanced Edition or should I be using the developer edition at the very least? The application builds without errors and works until the Get Parameters button is clicked. I was hoping to utilise this code in a project where all reports have default values so I need to be able to determine these values. The line in red in the code example below is the point at which the execution fails.
Thanks
Mike
Private Sub btnParameters_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnParameters.Click
'return the list of parameters for the report item
Dim reportItem As ReportItem = CType(cboReports.SelectedItem, ReportItem)
Dim parameters() As ReportParameter
parameters = _rs.GetReportParameters(reportItem.Path, Nothing, False, Nothing, Nothing)
'add the parameters to the parameter list UI
Dim left As Integer = 10
Dim top As Integer = 20
Dim parameter As ReportParameter
For Each parameter In parameters
Dim label As New Label
Dim textBox As New TextBox
label.Text = parameter.Prompt
label.Left = left
label.Top = top
textBox.Name = parameter.Name
textBox.Text = parameter.DefaultValues(0)
textBox.Left = left + 150
textBox.Top = top
top += 25
grpParamInfo.Controls.Add(label)
grpParamInfo.Controls.Add(textBox)
Next parameter
End Sub
Mike