When adding parameters to a SQLCommand, is there an overload that includes 'parameter name', 'type and 'value' otherwise i end up writing something like:
using cmd as new SQLCommand("SELECT x FROM y WHERE z = @z", cn)
Dim p0 as SQLParameter = cmd.Parameters.Add("@z", SQLDbType.Int)
p0.Value = 1
end using
I would like a one liner for adding the parameter.
Is there a better method of adding the parameter?
You can use extension methods (VB.NET 3.5) to write the new Add method with 3 arguments...
http://msdn.microsoft.com/en-us/library/bb384936.aspx