c# - Code generator to create ADO.NET SqlParemeter array from stored procedure inputs? -
i have sql server stored procedures have several inputs. want save time manually creating c# ado.net sqlparameter arrays in
sqlparameter[] sqlparameters = { new sqlparameter("customerid", sqldbtype.int, 4, parameterdirection.input, false, 0, 0, string.empty, datarowversion.default, custid) .......
any code generator can , template can this? if mention code generator, please mention template. 1 codesmith.
if don't have large number of stored procedures, can write macro in visual studio generate code (see this example). actually, depending on how write macro, can handle large number too.
if have no requirement manually crafted dal, should consider using orm (entity framework, linq sql .. etc) generate code you.
Comments
Post a Comment