protected void Button_generate_report_Click(object sender, EventArgs e)
{
cmd.CommandText =
SqlCommand cmd = new SqlCommand("patientrecord"); ALTER procedure [dbo].patientrecord@patient_regcode asbegin select select [clinic patient registartion].[patient reg code],[clinic patient registartion].[patient name],[clinic patient registartion].address,[clinic patient registartion].[phone no],[clinic opd info].[pv id],[clinic doctor].[name],[clinic pv treatments].[treatment id] from [clinic patient registartion],[clinic opd info],[clinic doctor],[clinic pv treatments] where [clinic patient registartion].[patient reg code]=@patient_regcodeend
@patient_regcode
as
begin
select
select [clinic patient registartion].[patient reg code],[clinic patient registartion].[patient name],[clinic patient registartion].address,[clinic patient registartion].[phone no],[clinic opd info].[pv id],[clinic doctor].[name],[clinic pv treatments].[treatment id] from [clinic patient registartion],[clinic opd info],[clinic doctor],[clinic pv treatments] where [clinic patient registartion].[patient reg code]=@patient_regcode
end
cmd.Connection = connection.get();connection.get();//dataGridView1.DataSource = ds;rpt.SetDataSource(ds);report_patienthistory.ReportSource= rpt;
rpt.SetDataSource(ds);
report_patienthistory.ReportSource= rpt;
}
da.SelectCommand = cmd;
da.Fill(ds);
Attachment: exception in my code.rar