OleDbCommand cmdpic = new OleDbCommand
("select * from sub_category where id_s="
+ Request.QueryString["id_s"]
+"or"+"order by sub_id desc", concars);
it shows error
what is the correct command
OleDbCommand cmdpic = new OleDbCommand
("select * from sub_category where id_s="
+ Request.QueryString["id_s"]
+"or"+"order by sub_id desc", concars);
it shows error
what is the correct command
Hi,
OleDbCommand cmdpic = new OleDbCommand
("select * from sub_category where id_s="
+ Request.QueryString["id_s"]
+" or "+"order by sub_id desc", concars);
I believe you forgot spaces in the "Or"
And providing the error message is of course very helpful :)
Edit: It appears you should remove the OR indeed.
Request.QueryString["id_s"]
+"or"+"order by sub_id desc"
You have no spaces in there. Try this:
OleDbCommand cmdpic = new OleDbCommand
("select * from sub_category where id_s="
+ Request.QueryString["id_s"]
+" or "+"order by sub_id desc", concars);
Actually, I think the real error was putting in the OR
in the first place. The missing spaces would have caused a problem, but that was invalid syntax anyway -- select x from y where a=b or order by z
is not valid in any SQL I have heard of.