Public Class Form1
Dim DSreport As New DataSet()
Dim SqlReader As SqlClient.SqlDataReader
Dim Conn As New SqlClient.SqlConnection()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cryRpt As New ReportDocument
cryRpt.Load("D:\งานเขียนโปรแกรม\เขียนโปแกรม วันที่ 24 -12-53 11.39\parktax 4\WindowsApplication1\WindowsApplication1\CrystalReport1.rpt")
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
Dim dsImg As New DataSet
Dim sql As String = "select ID, FName, LName,pic from Employee"
Dim strConn As String
strConn = "Data Source=.\SQLEXPRESS;Initial Catalog=Contacts_DB;Integrated Security=True"
Conn = New SqlConnection(strConn)
Conn.Open()
Dim DT As New DataTable("tempReport")
DT.Columns.Add("ID", GetType(String))
DT.Columns.Add("FName", GetType(String))
DT.Columns.Add("LName", GetType(String))
DT.Columns.Add("pic", GetType(System.Byte()))
DSreport.Tables.Add(DT)
Dim SqlAdapter As New SqlClient.SqlDataAdapter(sql, Conn)