Ok, I made a little progress from my form side. I had to modify some of your code to make it not error out. Here is my code that is in my form:
Dim myNum As String = "808080"
Dim myreport As New TagLabel
myreport.ReportParameters.Add("ParamTagNum", ReportParameterType.Integer, myNum)
ReportViewer1.Report = myreport
Here is the code that is in my Report NeedDataSourceEvent currently:
Dim sql As String = ""
sql = "SELECT * FROM myTable " & _
"WHERE TagNum = @TAGNUM"
Dim connectionString As SqlConnection
connectionString = New SqlConnection("xxxxxxx")
adapter.SelectCommand = New SqlCommand(sql, connectionString)
adapter.SelectCommand.Parameters.Add(New SqlParameter("@TAGNUM", "199"))
Dim dataSet As New DataSet()
Me.DataSource = dataSet
I have no idea how to take your code and put into the NeedDataSourceEvent.
int invNr = (int)ReportParameters["InvNr"].Value
That errors out. invNr says its not declared. Which I know but don't know what it is that I am declairing. Is it a string? Some other type of object? (int) doesn't accept that number of arguments.