I'm using ASP.NET forms to build some quite lengthy questionnaires. I'm creating each page using a FormView control with an attached SQL dataSource. The select query is easy enough- Visual Studio generates:
(select * from table)
but for the update query, Visual Studio gives me:
UPDATE table SET field1=,field2=... etc.
and I need:
UPDATE table SET field1=@field1,field2=@field2... etc.
At the moment, I'm copying each field name, pasting it after the = and adding an '@', but this gets really tedious.
Is there a way of automatically adding a parameter for each field?
OK, found the solution now.
NB, for this to work, your select statement must contain the Primary key of the table.