da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)
CrystalReportViewer1.ReportSource = report
dt.Clear()
da.Dispose()
conn.Close()
End Sub

i also try it with parameter

Cmd.CommandText = "Select * from RFinal where serialno=@a"

Cmd.Parameters.AddWithValue("@a", Form4.SerialNoTextBox.Text)

da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)">
da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)
CrystalReportViewer1.ReportSource = report
dt.Clear()
da.Dispose()
conn.Close()
End Sub

i also try it with parameter

Cmd.CommandText = "Select * from RFinal where serialno=@a"

Cmd.Parameters.AddWithValue("@a", Form4.SerialNoTextBox.Text)

da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)">
da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)
CrystalReportViewer1.ReportSource = report
dt.Clear()
da.Dispose()
conn.Close()
End Sub

i also try it with parameter

Cmd.CommandText = "Select * from RFinal where serialno=@a"

Cmd.Parameters.AddWithValue("@a", Form4.SerialNoTextBox.Text)

da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)">
i create a datatable in dataset in degine mode with union query.


query as below

SELECT DateofPickup AS Mdate, Name, Address, PhoneNo, SerialNo, DateofVist, ItemName, DateofPickup, TotalQty, Rateof, OpeningB, Dateofretrun, Retrun, Balance,
TotalDay, NULL AS adv
FROM Report
UNION ALL
SELECT Dateofpay AS Mdate, Name, Address, PhoneNo, SerialNno AS SerialNo, DateofVist, NULL AS ItemName, Dateofpay AS DateofPickup, NULL AS TotalQty, NULL
AS Rateof, NULL AS OpeningB, NULL AS Dateofretrun, NULL AS Retrun, NULL AS Balance, NULL AS TotalDay, Adv
FROM PaymentDetail

when i try to fill this datatable with where condation on page load event then it show error (No value given for one or more required parameters.) without where condation its work fine. code as below.

Dim report As New CrystalReport1
OpenConnect()
Cmd.CommandText = "Select * from RFinal where serialno='" & Form4.SerialNoTextBox.Text & "'"

da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)
CrystalReportViewer1.ReportSource = report
dt.Clear()
da.Dispose()
conn.Close()
End Sub

i also try it with parameter

Cmd.CommandText = "Select * from RFinal where serialno=@a"

Cmd.Parameters.AddWithValue("@a", Form4.SerialNoTextBox.Text)

da.SelectCommand = Cmd
da.Fill(ds, "rfinal")---------error occur here No value given for one or more required parameters
report.SetDataSource(ds)


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir