My project is running successfully but i have one problem in that project that it can not show the data after saving , it show the Crystal Report but in this it can't show the data
Please see the below mentioned code and solve the same
Dim insql As String = "INSERT INTO patient (recptno,pname,age,address,date,phone,refby,testcode,testname,amount) VALUES (@number1,@text2,@number3,@text4,@text5,@number6,@text7,@text8,@text9,@number10)"
cmd = New SqlCommand(insql, sqlconn)
cmd.Parameters.AddWithValue("@number1", reciepttxt.Text)
cmd.Parameters.AddWithValue("@text2", nametxt.Text)
cmd.Parameters.AddWithValue("@number3", agetxt.Text)
cmd.Parameters.AddWithValue("@text4", addresstxt.Text)
cmd.Parameters.AddWithValue("@text5", datetxt.Text)
cmd.Parameters.AddWithValue("@number6", phonetxt.Text)
cmd.Parameters.AddWithValue("@text7", refbytxt.Text)
cmd.Parameters.AddWithValue("@text8", testcodetxt.Text)
cmd.Parameters.AddWithValue("@text9", testnametxt.Text)
cmd.Parameters.AddWithValue("@number10", amounttxt.Text)
sqlconn.Open()
rowsins = cmd.ExecuteNonQuery
sqlconn.Close()
MessageBox.Show(rowsins.ToString & " row added")
Dim Report As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim CrystalReportViewer As CrystalDecisions.Windows.Forms.CrystalReportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer
CrystalReportViewer.ActiveViewIndex = 0
CrystalReportViewer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
CrystalReportViewer.DisplayGroupTree = False
CrystalReportViewer.Dock = System.Windows.Forms.DockStyle.Fill
CrystalReportViewer.Location = New System.Drawing.Point(0, 0)
CrystalReportViewer.Name = "CrystalReportViewer1"
Dim ds As New MDataSet
Dim sqlCon As SqlConnection
Dim dt As New DataTable
dt.TableName = "patient"
Form2.Show()
sqlCon = New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=blissdata;Integrated Security=True")
Dim da As New SqlDataAdapter("SELECT recptno,pname,age,address,date,phone,refby,testcode,testname,amount FROM patient", sqlCon)
da.Fill(dt)
Report.Load("C:\Users\Administrator\Documents\Visual Studio 2008\Projects\WindowsApplication1\WindowsApplication1\CrystalReport1.rpt")
Report.SetDataSource(ds)
Form2.CrystalReportViewer1.ReportSource = Report