i have using this code for print a specify row value in RDLC
SQL database:
create database test
create table fst(ename varchar(50),ecity varchar(50),ephno varchar(50))
button click coding:
con.Open();
string query = "select*from fst where ename='" + textBox1.Text + "'";
SqlCommand cmd = new SqlCommand(query, con);
this.reportViewer1.LocalReport.ReportEmbeddedResource = "WindowsFormsApplication3.Report1.rdlc";
ReportParameter[] para = new ReportParameter[3];
SqlDataReader dr = null;
dr = cmd.ExecuteReader();
if (dr.Read())
{
para[0] = new ReportParameter("ename", dr["ename"].ToString());
para[1] = new ReportParameter("ecity", dr["ecity"].ToString());
para[2] = new ReportParameter("ephno", dr["ephno"].ToString());
this.reportViewer1.LocalReport.EnableExternalImages = true;
this.reportViewer1.LocalReport.SetParameters(para);
this.reportViewer1.AutoScroll = true;
this.reportViewer1.AutoSize = true;
this.reportViewer1.RefreshReport();
}
con.Close();
Store Procedure coding:
create PROCEDURE demo ( @ename varchar(50),@ecity varchar(50),@ephno varchar(50))
AS insert into fst values(@ename,@ecity,@ephno)
in my some old project that coding work but now it show the error. please help. when i add SP paremeter in report textbox it show erroe is:
The Value expression for the text box ‘Textbox1’ refers to a non-existing report parameter ‘ename’