У меня ошибка объекта не задана ссылка на экземпляр объекта....
Я получил ссылку на объект error, не заданную на экземпляр объекта для загрузки отчета.
Public Sub Print() Try Cursor = Cursors.WaitCursor Timer1.Enabled = True Dim rpt As New rptInvoice 'The report you created. Dim myConnection As MySqlConnection Dim MyCommand, MyCommand1 As New MySqlCommand() Dim myDA, myDA1 As New MySqlDataAdapter() Dim myDS As New DataSet 'The DataSet you created. myConnection = New MySqlConnection(cs) MyCommand.Connection = myConnection MyCommand1.Connection = myConnection ' MyCommand.CommandText = "SELECT tblcustomer.ID, tblcustomer.cust_name, tblcustomer.address, tblcustomer.city, tblcustomer.state, tblcustomer.pincode, tblinvoice.Inv_ID, tblinvoice.InvoiceNo, tblinvoice.InvoiceDate, tblinvoice.CustomerID , tblinvoice.DiscountAmt, tblinvoice.GrandTotal, tblinvoice_product.InvP_ID, tblinvoice_product.InvoiceID, tblinvoice_product.ProductID, tblinvoice_product.CostPrice, tblinvoice_product.Qty, tblinvoice_product.Amount, tblinvoice_product.TotalAmount, tblproduct.PID, tblproduct.ProductName, tblproduct.SubCategory, tblproduct.HSNCode, tblproduct.IGST FROM tblcustomer INNER JOIN tblinvoice ON tblcustomer.ID = tblinvoice.CustomerID INNER JOIN tblinvoice_product ON tblinvoice.Inv_ID = tblinvoice_product.InvoiceID INNER JOIN tblproduct ON tblinvoice_product.ProductID = tblproduct.PID where tblinvoice.Inv_ID=@d1" ' MyCommand.Parameters.AddWithValue("@d1", txtInvoiceID.Text) MyCommand1.CommandText = "SELECT * from tblcompany" MyCommand.CommandType = CommandType.Text MyCommand1.CommandType = CommandType.Text myDA.SelectCommand = MyCommand myDA1.SelectCommand = MyCommand1 myDA.Fill(myDS, "tblinvoice") myDA.Fill(myDS, "tblinvoice_product") myDA.Fill(myDS, "tblcustomer") myDA.Fill(myDS, "tblproduct") myDA1.Fill(myDS, "tblcompany") rpt.SetDataSource(myDS) rpt.SetParameterValue("p1", txtCustid.Text) rpt.SetParameterValue("p2", Today) frmReport.CrystalReportViewer1.ReportSource = rpt frmReport.ShowDialog() Catch ex As Exception MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub
Что я уже пробовал:
найдите нулевое значение, но не получите его..