Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
stored procedure
vineet pathak
14y
2.2k
1
Reply
Hi all
I am using stored procedure to search within crystal reports.I have used the code as follows.On search button click I have written:
//Search_button click//
SqlConnection
con =
new
SqlConnection
(
"Data Source=server;Initial Catalog=CR;User ID=uttam;Password=uttam"
);
SqlCommand
cmd =
new
SqlCommand
(
"spSearch"
,con);
cmd.Parameters.Add(
"@search1"
,
SqlDbType
.VarChar).Value = TextBox1 .Text;
cmd.Parameters.Add(
"@search2"
,
SqlDbType
.VarChar).Value = TextBox2 .Text;
cmd.CommandType =
CommandType
.StoredProcedure;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
//stored procedure//
CREATE
PROCEDURE
spSearch
(
@Search1
varchar
(
50
),
@Search2
varchar
(
50
)
)
AS
BEGIN
SET
NOCOUNT
ON
;
-- Insert statements for procedure here
SELECT
*
FROM
cr2
Where
FirstName
=
@search1
and
LastName
=
@search2
END
Now the issue is the changes are not been r eflected in the report viewer.is there anything that I am missing or I ahve to include in my code.
Its urgent Please reply
Thanks
Vineet
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
calling a web service method in WCF layer
DataList and SqlDataSource SelectCommand Parameter