Developer forum

Forum » Development » API Feature Request

API Feature Request


Reply
API Feature Request - Overload method on Dynamicweb.Database.ExecuteNonQuery

Would be nice if the method could take a SqlCommand instead of a string as it can produce alot of problems with ' in the various field values

Replies

 
Nicolai Høeg Pedersen
Reply
If you already have the command, can't you just do like this:
myCommand.ExecuteNonQuery();?
 
Reply
Yeah but u will have to create a sqlconn based upon the globalsettings and open close etc. etc. i mean its not a big deal todo as we allrdy do this today.

But since the feature is in the APi it would be nice if i could just pass the Sqlcommand to it to avoid ' issues etc, would make sense in my head atleast :)
 
Nicolai Høeg Pedersen
Reply
But you use a idbconnection.createcommand - so you cannot create a command without a connection... Or am I missing something? Probably :-).

And if you use Base.Request("") it will handle ' problems for you:

select * from table where somefield = base.request("someparameter")

Base.Request have a wide variety of sql injection prevention inside - and is updated on a regular basis.

 

You must be logged in to post in the forum