Got my butt handed to me by the ADO.NET 2.0 Designer today for awhile, but I feel I had the last laugh.
I was adding a datatable and using an existing stored procedure to populate it when I see the message below. INVALID OBJECT NAME '#TEMP.' Couldn't go next, couldn't finish, couldn't populate my ADO.NET DataTable. What to do?
I'm a SQL temporary table guy from way back. They're beautiful things and there was no way I could generate the data I needed any other way. Then I thought, "Hey, I'll just trick the rascal!" The Designer doesn't have to know anything about temporary tables in my Stored Proc. All it needs to know is the stored procedure name, params in, and columns out! So I create the datatable columns, modify the proc to do a simple select resulting in the fields I'd need, and bingo! Everyone's happy. Then I went back and added the #temp table logic to the stored procedure and was able to get on with my life.