I have a GridView that loads correctly from a SQL table using a TableAdapter
and stored procedures. However, when I try to delete from the GridView, I get
"Procedure or Function 'EventDelete' expects parameter '@Original_Comment',
which was not supplied."
Of course, the call to EventDelete was generated by Visual Studio, making it
hard to debug. In fact, I nothing in the stack trace is my code. If I remove
the parameter @OriginalComment from the stored procedure (since it isn't
really needed), then it tells me there are too many parameters, compared to
the message above, which seems to say there are too few.
I have recreated all the objects in VS and regenerated the Table Adapter,
the stored procedures, and the columns in the GridView, but I cannot make it
work.
The Table Adapter is generated from a select statement with some extra,
calculated values, which are needed because I cannot get the date for format
correctly in ASP.NET, and therefore I use SQL.
Here is the select statement:
select
[GroupKey],
[Date],
convert(varchar,[Date],1) as [DateFormatted],
[Comments],
convert(varchar,[Date],1) + ' ' + Comments as LongDescription
from [Event]
where GroupKey = @GroupKey
order by [Date]
All the generated stored procedures and everthing in the table adapter look
correct to me.
Can anyone suggest what is wrong? Thanks.