c# - why asp.net wont delete my row? -


im trying delete row database,

this code :

sql = "delete sum_lines sum_lines join sum_tbl on sum_lines.summary_id = sum_tbl.id sum_tbl.user_id = @userid , sum_lines.line_id ='@lineid'";          sqlconnection con = new sqlconnection(constring);         dataobj = new dataobj();         sqlcommand com = new sqlcommand(sql, con);         com.parameters.add(new sqlparameter("@userid", userid));         com.parameters.add(new sqlparameter("@lineid", lineid));           con.open();         com.executenonquery();         con.close(); 

the thing is, if im trying sql statement in management tool , works perfectly. wont effect on database when code running.

it go code, can see in debug mode, wont effecting reason . inputs ?

remove single quotes around '@lineid'. quotes specifying value equal @lineid string in second condition.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -