Private Sub customerReportForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim reportdoc As New ReportDocument
Dim logoninfo As New TableLogOnInfo
reportdoc.Load("C:\Users\fsze88\Desktop\kennam\vb.NET\kennamCustomers.rpt")
Dim oradb As String = "Data Source=kennam;User Id=kennam;Password=kennam007;" ' VB.NET
Dim conn As New OracleConnection(oradb)
conn.Open()
Dim sql As String = "select * from customers " ' VB.NET
Dim cmd As New OracleCommand(sql, conn)
cmd.CommandType = CommandType.Text
Dim dr As OracleDataReader = cmd.ExecuteReader()
Dim ds As New DataSet()
Dim adapter As New OracleDataAdapter(sql, conn)
adapter.Fill(ds)
' For Each table In reportdoc.Database.Tables
' logoninfo = Table.LogOnInfo
'logoninfo.ConnectionInfo.ServerName = "localhost"
'logoninfo.ConnectionInfo.DatabaseName = "kennam"
'logoninfo.ConnectionInfo.UserID = "kennam"
'logoninfo.ConnectionInfo.Password = "kennam007"
'Table.ApplyLogOnInfo(logoninfo)
'Next table
CrystalReportViewer1.ShowRefreshButton = False
CrystalReportViewer1.ReportSource = reportdoc
End Sub
|