asp.net - Protecting querystring variable for use in SQL query parameter -


i'm writing simple website act discussion board/forums in vb.net.

when user clicks on forum, forum id put in querystring variable "topic" page reads , collects topics forum id. likewise, when user clicks on topic, post page collect posts topic id.

ie:

f_id = request.querystring("f_num") mycommand = new sqlcommand("select * forum_topics forum_id = @id", myconnection) mycommand.parameters.addwithvalue("@id", f_id) 

my question is:

while use id parameter in sql query, should id in variable before or after using or passing page purposes of security?

are there best practices governing using querystring transport data page page?

and lastly, there different method should use if 1 not secure enough?

for purposes of question, long user logged in (handled elsewhere) allowed see , topics.

thanks!


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -