Last post Aug 26, 2014 03:26 PM by MetalAsp.Net
Aug 26, 2014 02:09 PM|jjmonty|LINK
I have seen two methods of adding OracleParameters to a db request in .Net:
1) creating an OracleParameters array and adding individual OracleParameters one-by-one
OracleParameters = new OracleParameter(...)
2) creating an OracleCommand and using
Of these two, is one preferred in terms of performance?
Are there any other methods?
Has anyone got hard numbers on this?
Aug 26, 2014 03:26 PM|MetalAsp.Net|LINK
To me, method 2 is nicer. Can't really say why, but it's my preference. I dislike working with arrays and try to avoid them whenever possible.
Now, as far as performance I doubt you'll see any measurable differences between the two, so don't sweat it :) and use the one you prefer.
Actually my preference is to use the AddWithValue() method but that's a minor difference/preference from using .Add().