Linq-to-SQL fails to reflect changes in one stored procedure
I exposed several stored procedures via linq-to-SQL. After some time I realized I needed one more column returned by those procedures, so I changed the procedures, deleted them in the design pad, and dragged again.
I do see the new column exposed in all my procedures except one - its helper class did not change at all. When I execute that stored procedure directly, I do see the new column.
What am I missing? Closing and reopening VS did not help. Cleaning the solution did not help either. The only workaroun开发者_如何学编程d that actually worked was to rename the procedure. Is this a bug in linq-to-sql or am i missing something?
TIA
I have run across that before as well. The quickest way I found was to drop the SP attempt a build (assuming you are referencing it somewhere) it will cause build errors. Then when you add the SP back in and do a rebuild all it will re-write the metadata
Yes, the designer is pretty picky, especially with stored procs. If the name and the output fields are the same, it doesn't actually refresh the metadata of the stored procedure because all it cares about is what to call and what to expect back. The stored procedure logic is irrelevant to L2S.
Confirm you see the change in server explorer, particularly the output fields of the proc (you may have to do a refresh in server explorer to make it appear), then reimport and compile again.
Should work then.
Some times vs studio caches them and refresh does nothing, try restarting vs studio deleting and dragging in them again.
精彩评论