<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3773728416858904414</id><updated>2011-04-21T16:02:07.630-07:00</updated><title type='text'>NUTS about .NET</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nutsaboutnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3773728416858904414/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nutsaboutnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>sAiK</name><uri>http://www.blogger.com/profile/12690293164862524974</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3773728416858904414.post-7735958834364275692</id><published>2009-03-30T07:35:00.000-07:00</published><updated>2009-03-30T07:50:39.705-07:00</updated><title type='text'>Dataset TableDataAdapter throws "Invalid object name" for temp tables</title><content type='html'>I added a dataset to my C# .NET project visually and tried adding a TableDataAdapter to it using a stored procedure which I had written previously. This stored procedure has a temp table #Attrition within it and the TableDataAdapter Configuration Wizard didn't seem to like this. I got an error Invalid object name "#Attrition". The solution that I figured for this is to use a @table variable instead of temp table. So I replaced&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;CREATE TABLE #Attrition&lt;br /&gt;(&lt;br /&gt;DeptID int,&lt;br /&gt;Voluntary int&lt;br /&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;with&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DECLARE @Attrition TABLE&lt;br /&gt;(&lt;br /&gt;DeptID int,&lt;br /&gt;Voluntary int&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and also removed the following statement at the end of the procedure&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DROP TABLE #Attrition&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This seems to have done the trick.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3773728416858904414-7735958834364275692?l=nutsaboutnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nutsaboutnet.blogspot.com/feeds/7735958834364275692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nutsaboutnet.blogspot.com/2009/03/dataset-tabledataadapter-throws-invalid.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3773728416858904414/posts/default/7735958834364275692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3773728416858904414/posts/default/7735958834364275692'/><link rel='alternate' type='text/html' href='http://nutsaboutnet.blogspot.com/2009/03/dataset-tabledataadapter-throws-invalid.html' title='Dataset TableDataAdapter throws &quot;Invalid object name&quot; for temp tables'/><author><name>sAiK</name><uri>http://www.blogger.com/profile/12690293164862524974</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
