Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Asp.net crystal report setparamertvalue function not working visual studio 2012.I have table Players in database
in which countryCode value is 1...10.I want to show specific country record in crystal report but crystal report show all records instead of specific record countrycode 3
C#
cn.Open();
           SqlCommand cmd = new SqlCommand("empp", cn);
           cmd.CommandType = CommandType.StoredProcedure;
           SqlDataAdapter da = new SqlDataAdapter(cmd);
           DataTable ds = new DataTable();
           da.Fill(ds);
           rdoc.Load(Server.MapPath("CrystalReport1.rpt"));
           rdoc.SetDataSource(ds);
           rdoc.SetParameterValue("conID", 3);
           CrystalReportViewer1.ReportSource = rdoc;
           CrystalReportViewer1.DataBind();
           cn.Close();


<pre lang="SQL">
create PROCEDURE empp
AS
BEGIN
	SELECT * FROM Players
END



{Players.countryCode}={?conID}

Guide me how to solve this problem
Posted
Comments
[no name] 13-Jul-14 18:28pm    
Your code is doing exactly what you told it to do. Start at http://www.w3schools.com/sql/default.asp to learn some SQL.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900