Click here to Skip to main content
   

ASP.NET

 
QuestionMicrosoft Sync Framework for File (Client) and SQL Server Database (Server) synchronization PinmemberAjeet mittal27-Dec-12 18:27 
QuestionWhat is the web.config for the <smtp> ? Pinmemberalihusain_7727-Dec-12 10:38 
AnswerRe: What is the web.config for the <smtp> ? PinmvpRichard MacCutchan27-Dec-12 23:02 
AnswerRe: What is the web.config for the <smtp> ? [modified] PinmemberCommDev28-Dec-12 22:38 
QuestionImage album category wise PinmemberMember 776731127-Dec-12 8:30 
AnswerRe: Image album category wise PinmvpSandeep Mewara28-Dec-12 22:24 
QuestionCapsLock detection Pinmembertpkpradeep27-Dec-12 1:04 
AnswerRe: CapsLock detection PinmemberAnalogNerd27-Dec-12 4:56 
AnswerRe: CapsLock detection [modified] PinmemberCommDev28-Dec-12 22:50 
QuestionApplication Layering PinmemberOmersayeed26-Dec-12 3:31 
QuestionSyntax error in store procedure Pinmemberanubhaw.gupta25-Dec-12 23:06 
AnswerRe: Syntax error in store procedure PinmemberSravanthid2825-Dec-12 23:21 
GeneralRe: Syntax error in store procedure Pinmemberanubhaw.gupta25-Dec-12 23:40 
AnswerRe: Syntax error in store procedure Pinmemberanubhaw.gupta25-Dec-12 23:45 
 

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 Pinmembersathish s26-Dec-12 2:39 
GeneralRe: Syntax error in store procedure PinmemberZafar Sultan26-Dec-12 4:31 
Questionid or guid.. which one? PinmemberJassim Rahma25-Dec-12 8:22 
AnswerRe: id or guid.. which one? PinmvpSandeep Mewara25-Dec-12 20:14 
AnswerRe: id or guid.. which one? [modified] PinmemberCommDev25-Dec-12 20:25 
Questionwhy should I care about ExecuteScalar PinmemberJassim Rahma25-Dec-12 6:57 
AnswerRe: why should I care about ExecuteScalar PinmvpSandeep Mewara25-Dec-12 20:30 
AnswerRe: why should I care about ExecuteScalar PinmemberCommDev25-Dec-12 20:33 
AnswerRe: why should I care about ExecuteScalar PinmemberCommDev25-Dec-12 20:40 
GeneralRe: why should I care about ExecuteScalar PinmemberJassim Rahma28-Dec-12 10:40 
GeneralRe: why should I care about ExecuteScalar PinmemberNaveen Katta26-Dec-12 1:10 
Questiona control that should contain html elements [modified] PinmemberAli Al Omairi(Abu AlHassan)24-Dec-12 0:01 
QuestionRe: a control that should contain html elements Pinmemberjkirkerx24-Dec-12 14:09 
AnswerRe: a control that should contain html elements PinmemberAli Al Omairi(Abu AlHassan)25-Dec-12 20:51 
Questioncheckedchange event of gridview in javascript PinmemberRavi_kant23-Dec-12 20:29 
AnswerRe: checkedchange event of gridview in javascript PinmemberSampath Kumar Sathiya24-Dec-12 1:20 
GeneralRe: checkedchange event of gridview in javascript PinmemberRavi_kant24-Dec-12 8:40 
Questionupdated data from gridview PinmemberMember 970720723-Dec-12 1:30 
AnswerRe: updated data from gridview PinmemberAli Al Omairi(Abu AlHassan)24-Dec-12 5:31 
AnswerRe: updated data from gridview PinmvpSandeep Mewara25-Dec-12 20:35 
Question.net question PinmemberTarani Dutt Joshi22-Dec-12 0:53 
AnswerRe: .net question PinmvpRichard MacCutchan22-Dec-12 1:18 
AnswerRe: .net question PinmemberMaulikDusara24-Dec-12 22:38 
AnswerRe: .net question PinmvpSandeep Mewara25-Dec-12 20:33 
QuestionWebRequest Pinmembercdpsource21-Dec-12 15:16 
Questionwebpage has resulted in too many redirects PinmemberJassim Rahma21-Dec-12 10:46 
AnswerRe: webpage has resulted in too many redirects Pinmemberjkirkerx22-Dec-12 19:50 
GeneralRe: webpage has resulted in too many redirects PinmemberJassim Rahma23-Dec-12 9:36 
GeneralRe: webpage has resulted in too many redirects Pinmemberjkirkerx23-Dec-12 9:47 
GeneralRe: webpage has resulted in too many redirects PinmemberJassim Rahma24-Dec-12 10:10 
GeneralRe: webpage has resulted in too many redirects Pinmemberjkirkerx24-Dec-12 14:05 
Questionpop up on mouse over on a image button PinmemberYasir88721-Dec-12 7:42 
AnswerRe: pop up on mouse over on a image button PinmemberAnalogNerd21-Dec-12 10:26 
GeneralRe: pop up on mouse over on a image button PinmemberYasir88721-Dec-12 18:09 
AnswerRe: pop up on mouse over on a image button Pinmembern.podbielski22-Dec-12 22:50 
AnswerRe: pop up on mouse over on a image button [modified] PinmemberCommDev23-Dec-12 15:35 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150123.1 | Last Updated 26 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid