Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I saw this link,
csharp.net-informations.com
but I need it fully developed using query.my table and query is
SQL
create table sample(roomno nvarchar(20),ondate datetime,offdate datetime)

insert into sample values(301,'01/26/2013 10:41:08','02/26/2013 10:41:08')
insert into sample values(302,'03/26/2013 15:41:08','02/26/2013 20:41:08')
insert into sample values(301,'02/26/2013 10:41:08','06/26/2013 10:41:08')
insert into sample values(303,'01/26/2013 10:41:08','01/26/2013 13:41:08')
insert into sample values(304,'06/26/2013 10:41:08','08/26/2013 10:41:08')
insert into sample values(305,'09/26/2013 10:41:08','11/26/2013 10:41:08')

create procedure smpl AS
BEGIN
select * from sample
end

I need to know how I send the datetime picker and id no as parameter...
Posted
Updated 4-Feb-13 8:24am
v3

1 solution

better to rewrite the stored procedure like below:
SQL
CREATE PROCEDURE smpl
	@roomno VARCHAR(20),
	@ondate DATETIME,
	@offdate DATETIME
AS
BEGIN
	SELECT roomno,
	       roomno,
	       offdate
	FROM   [sample] s
	WHERE  s.roomno = @roomno
	       AND s.ondate = @ondate
	       AND s.offdate = @offdate
END


Use this stored procedure as the data source of crystal report and follow the link below to pass parameter from C#.
Crystal Report Filtering Using Selection Parameters[^]
 
Share this answer
 

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