我正在开发一个网络应用程序,我无法在我的水晶报告中显示任何结果。我不知道我的代码有什么问题。请帮忙。
Dim cnn As SqlConnection
Dim connectionString As String
Dim sql As String
connectionString = "data source=SERVERNAME; _
initial catalog=crystaldb;user id=sa;password=PASSWORD;"
cnn = New SqlConnection(connectionString)
cnn.Open()
sql = "SELECT * FROM Grades
Dim dscmd As New SqlDataAdapter(sql, cnn)
Dim ds As New DataSet1
dscmd.Fill(ds, "Grades")
objRpt.SetDataSource(ds.Tables(1))
CrystalReportViewer1.ReportSource = objRpt
CrystalReportViewer1.RefreshReport()