Click here to Skip to main content
15,887,394 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCapsLock detection Pin
tpkpradeep27-Dec-12 0:04
tpkpradeep27-Dec-12 0:04 
AnswerRe: CapsLock detection Pin
AnalogNerd27-Dec-12 3:56
AnalogNerd27-Dec-12 3:56 
AnswerRe: CapsLock detection Pin
CommDev28-Dec-12 21:50
CommDev28-Dec-12 21:50 
QuestionApplication Layering Pin
Omersayeed26-Dec-12 2:31
Omersayeed26-Dec-12 2:31 
QuestionSyntax error in store procedure Pin
anubhaw.gupta25-Dec-12 22:06
anubhaw.gupta25-Dec-12 22:06 
AnswerRe: Syntax error in store procedure Pin
Sravanthid2825-Dec-12 22:21
Sravanthid2825-Dec-12 22:21 
GeneralRe: Syntax error in store procedure Pin
anubhaw.gupta25-Dec-12 22:40
anubhaw.gupta25-Dec-12 22:40 
AnswerRe: Syntax error in store procedure Pin
anubhaw.gupta25-Dec-12 22:45
anubhaw.gupta25-Dec-12 22:45 
C#
alter procedure mdi_anu  
(  
@entry_date varchar(20),  
@updated_date varchar(20),  
@status varchar(20),  
@cno varchar(20),  
@eno varchar(20)
)  
  
as 
begin
declare @SQL varchar(max)  
set @SQL='SELECT * FROM anu123 where 1=1 '  
  
	--if (@status='ALL')  
	--	begin  
	--	set @status='ALL'  
	--	set @SQL=@SQL + 'and status=''' +@status
	--end  
  
	if (@status='A')  
		begin  
		set @status='A'  
		--set @SQL=@SQL+' and status='''+@status
	end  
  
	if (@status='R')  
		begin  
		set @status='R'  
		set @SQL=@SQL+' and status=''' +@status
	end  
  
	if (@status='D')  
		begin  
		set @status='D'  
		set @SQL=@SQL+' and status=''' +@status
	end  
  
	if (@status='P')  
		begin  
		set @status='P'  
		set @SQL=@SQL+' and status=''' +@status
	end 
	
	
	 
	if (@entry_date<>'' and @updated_date<>'')  
	begin  
   
	set @entry_date =CONVERT (datetime, @entry_date, 103)        
	set @updated_date= CONVERT(datetime, @updated_date, 103)  
	set @SQL=@SQL+'and entry_date>=''' +@entry_date+'''and updated_date<='''+@updated_date+''''  
	end
  
	if (@cno<>'')  
	begin  
	set @cno=@cno  
	set @SQL=@SQL+'and cno=''' +@cno+
	end  

  
	if (@eno<>'')  
	begin  
	set @eno=@eno  
	set @SQL=@SQL+'and eno=''' +@eno+
	end 

exec (@SQL)

end


the error which m getting is that,suppose m choosing 'D' as my input in the status i get
"Unclosed quotation mark after the character string 'D'.
Incorrect syntax near 'D'."
Whats the problem?
GeneralRe: Syntax error in store procedure Pin
sathish s26-Dec-12 1:39
sathish s26-Dec-12 1:39 
GeneralRe: Syntax error in store procedure Pin
Zafar Sultan26-Dec-12 3:31
Zafar Sultan26-Dec-12 3:31 
Questionid or guid.. which one? Pin
Jassim Rahma25-Dec-12 7:22
Jassim Rahma25-Dec-12 7:22 
AnswerRe: id or guid.. which one? Pin
Sandeep Mewara25-Dec-12 19:14
mveSandeep Mewara25-Dec-12 19:14 
AnswerRe: id or guid.. which one? Pin
CommDev25-Dec-12 19:25
CommDev25-Dec-12 19:25 
Questionwhy should I care about ExecuteScalar Pin
Jassim Rahma25-Dec-12 5:57
Jassim Rahma25-Dec-12 5:57 
AnswerRe: why should I care about ExecuteScalar Pin
Sandeep Mewara25-Dec-12 19:30
mveSandeep Mewara25-Dec-12 19:30 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 19:33
CommDev25-Dec-12 19:33 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 19:40
CommDev25-Dec-12 19:40 
GeneralRe: why should I care about ExecuteScalar Pin
Jassim Rahma28-Dec-12 9:40
Jassim Rahma28-Dec-12 9:40 
GeneralRe: why should I care about ExecuteScalar Pin
Naveen Katta26-Dec-12 0:10
Naveen Katta26-Dec-12 0:10 
Questiona control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)23-Dec-12 23:01
professionalAli Al Omairi(Abu AlHassan)23-Dec-12 23:01 
QuestionRe: a control that should contain html elements Pin
jkirkerx24-Dec-12 13:09
professionaljkirkerx24-Dec-12 13:09 
AnswerRe: a control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)25-Dec-12 19:51
professionalAli Al Omairi(Abu AlHassan)25-Dec-12 19:51 
Questioncheckedchange event of gridview in javascript Pin
Ravi_kant23-Dec-12 19:29
Ravi_kant23-Dec-12 19:29 
AnswerRe: checkedchange event of gridview in javascript Pin
Sampath Kumar Sathiya24-Dec-12 0:20
Sampath Kumar Sathiya24-Dec-12 0:20 
GeneralRe: checkedchange event of gridview in javascript Pin
Ravi_kant24-Dec-12 7:40
Ravi_kant24-Dec-12 7:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.