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
aadi patel
NA
53
33.5k
dynamic stored procedure and bind result into asp.net gridview using passing parameters
Aug 24 2012 4:23 AM
i need to develop sql server "dynamic stored procedure " according to passed parameters and bind result into grid view.
below my stored procedure.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
USE DATABASE
GO
CREATE PROCEDURE procedure_name
@LOGIN_ID INT
AS
Declare @SQLQuery AS NVARCHAR(4000)
Declare @ParamDefinition AS NVARCHAR(2000)
Set @SQLQuery = 'SELECT * FROM TABLE WHERE (1=1) '
If @LOGIN_ID = '0'
Set @SQLQuery = @SQLQuery
ELSE
Set @SQLQuery = @SQLQuery + 'AND LOGIN_ID=@LOGIN_ID '
Set @ParamDefinition = '@LOGIN_ID INT'
Execute sp_Executesql @SQLQuery,
@ParamDefinition,@LOGIN_ID
GO
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
please help.
my mail id is :
[email protected]
Reply
Answers (
4
)
how to display random number in vb.net c# coding?
Position of a click on a picturebox