i have problem to make the procedure to return three value the problem appear when running crystal report returning empty values.
*proceduer running
USE [smart_training]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[comming_num_zero]
@fld varchar(200),@val varchar(200),@ral varchar(200)
as
DECLARE @sql nvarchar(max) =
'SELECT [area]
,[zone]
,[date]
,[course]
,[totalnum]
,[clocknum]
,[commingnum]
,[absent]
,[repeating]
,[supervisor_name]
,[course_price]
,[total_price]
FROM [smart_training].[dbo].[account_head] inner join acountment on account_head.action =acountment.action where '+@fld + ' = '''+@val+''+@ral+''''
exec sp_executesql @sql
running crystal report
if (radioButton1.Checked && radioButton6.Checked)
{
commaing_zero2 myreport2 = new commaing_zero2();
myreport2.SetParameterValue("@fld", "account_head.area");
myreport2.SetParameterValue("@val",comboBox1.Text);
myreport2.SetParameterValue("@ral", "and acountment.totalnum=acountment.commingnum");
Form6 myform = new Form6();
myform.crystalReportViewer1.ReportSource = myreport2;
myform.ShowDialog();
}
<pre lang="c#">