Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Faking Out the ADO.NET 2.0 Designer

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. 

Comments (1) | Post RSS RSS comment feed

Posted on 6/27/2005 6:38:00 PM by Dave Burke
Categories: .NET
Tags:

Related posts

Comments (1) -

6/28/2005 10:46:43 PM Permalink

Yeah,
We do have challenges getting info from sprocs that use #temp tables.  This is one of the downsides of the magic way we infer the resultset without actually prompting users for the parameters of the sproc.  This is one of the areas we want to improve in VNext.  Including updatable joins, views, and a host of other stuff.  I'm hoping to find the time to post some of our intial thoughts soon.
Steve Lasker
Program Manager
Visual Studio – Smart Client Data
Blogs.msdn.com/SmartClientData

Steve Lasker |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke