TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
parthiban karnan
NA
549
101.3k
HOW TO CODE FOR THE THIS STOREDPROCEDURE
May 27 2013 6:45 AM
I GOT A STORED PROCEDURE FOR RETRIEVING DATA FROM FILTERED SEARCH.. A DROPDOWN WITH FIRSTNAME,LASTNAME AND EMAIL AND A TEXTBOX WHICH FILTERS WITH EXACT SEARCH..
BELOW IS SP.. HOW TO CODE FOR THIS...
IF I CHOOSE FIRTSNAME FROM DDL AND ENTER FIRSTNAME IN TEXTBOX.. IT HAS TO FILTER AND BIND WITH EXACT DETAILS IN GRIDVIEW...SAME AS FOR LASTNAME AND EMAIL...
Create Procedure [dbo].[spSearch]
(
@firstName nvarchar(50) = null,
@lastName nvarchar(50) = null,
@email nvarchar(50) = null
)
AS
BEGIN
If @firstName is not null and Len(@firstName )=0 Set @firstName = null
If @lastName is not null and Len(@lastName )=0 Set @lastName = null
If @email is not null and Len(@email )=0 Set @email = null
Select
*
From userinf
Where
( @firstName is null or firstName Like @firstName )
and ( @lastName is null or lastName Like @lastName )
and ( @email is null or email Like @email )
END
GO
Reply
Answers (
5
)
Crystal Reports Direct Print in ASP .NET Client System - Fil
showing username based on the using machine name in c#