I am adding a stored procedure event and using the code below which I got from another thread about stored procedures and fit it for my needs. Unfortunately, I am getting errors on the (.Load). The error says "Event Load Cannot be Found" and IsPostBack is not declared.
Any help would be appreciated. The code I am using is below. Also, if you see any other errors with the code let me know, thanks.
Any help would be appreciated. The code I am using is below. Also, if you see any other errors with the code let me know, thanks.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack = False Then
Dim myReport As New Report1()
Dim sql = "[dbo].[spMBUser]"
Dim connectionString = "Data Source=MyServer;Initial Catalog=NDB;Integrated Security=True"
Dim command As New SqlCommand(sql, New SqlConnection(connectionString))
command.CommandType = CommandType.StoredProcedure
Dim sqlparam As New SqlParameter("@uval", SqlDbType.NVarChar)
sqlparam.Value = 3
command.Parameters.Add(sqlparam)
Dim adapter As New SqlDataAdapter(command)
Dim dataSet As New DataSet()
adapter.Fill(dataSet)
myReport.DataSource = dataSet.Tables(0)
Dim reportSourceInstance1 As New InstanceReportSource()
reportSourceInstance1.ReportDocument = myReport
reportSourceInstance1.Parameters.Add("uval", HttpContext.Current.User.Identity.Name)
ReportViewer1.ReportSource = reportSourceInstance1
End If
End Sub