Problem with VS2010 suddenly not knowing what a DataTable is.http://forums.asp.net/t/1804779.aspx/1?Problem+with+VS2010+suddenly+not+knowing+what+a+DataTable+is+Thu, 17 May 2012 15:10:11 -040018047794985548http://forums.asp.net/p/1804779/4985548.aspx/1?Problem+with+VS2010+suddenly+not+knowing+what+a+DataTable+is+Problem with VS2010 suddenly not knowing what a DataTable is. <p>Hello everyone,</p> <p>I'm running into a weird problem using pretty much standard code that I've used in dozens of other projects with no problem. It compiles fine but when I run in debug on localhost I get a compile error.&nbsp; I'm on a Windows7 thin client with VS2010 but I've used this code in several other projects in the same dev environment.</p> <p><b>Compiler Error Message: </b>BC30002: Type 'DataTable' is not defined.<br> <br> <b>Source Error:</b><br> <br> </p> <table bgcolor="#ffffcc" width="100%"> <tbody> <tr> <td></td> </tr> <tr> <td> <pre>Line 9: cn = New OracleConnection(&quot;Data Source=&quot; &amp; HttpContext.Current.Application(&quot;sDataBase&quot;) &amp; &quot;; User Id=&quot; &amp; HttpContext.Current.Session(&quot;UserID&quot;) &amp; &quot;; Password=&quot; &amp; HttpContext.Current.Session(&quot;Password&quot;) &amp; &quot;; Pooling=False;&quot;) Line 10: End Sub <span color="red" style="color:red">Line 11: Function GetBin() As DataTable <br></span>Line 12: Dim SQL As String Line 13: cn = New OracleConnection(HttpContext.Current.Session(&quot;ConnectString&quot;))</pre> </td> </tr> </tbody> </table> <p>I'm not even going to get into how idiotic it is to get a compile error after a successful compile with no errors.&nbsp; Anyone have any ideas what the problem is?&nbsp; My relevant source code is here:</p> <p>Imports Oracle.DataAccess.Client<br> Imports Oracle.DataAccess.Types<br> Public Class TBINData<br> &nbsp;&nbsp; &nbsp;Implements IDisposable<br> &nbsp;&nbsp; &nbsp;Dim cn As OracleConnection<br> &nbsp;&nbsp; &nbsp;Public IsDisposed As Boolean = False<br> <br> &nbsp;&nbsp; &nbsp;Public Sub New()<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cn = New OracleConnection(&quot;Data Source=&quot; &amp; HttpContext.Current.Application(&quot;sDataBase&quot;) &amp; &quot;; User Id=&quot; &amp; HttpContext.Current.Session(&quot;UserID&quot;) &amp; &quot;; Password=&quot; &amp; HttpContext.Current.Session(&quot;Password&quot;) &amp; &quot;; Pooling=False;&quot;)<br> &nbsp;&nbsp; &nbsp;End Sub<br> &nbsp;&nbsp; &nbsp;Function GetBin() As DataTable<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Dim SQL As String<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cn = New OracleConnection(HttpContext.Current.Session(&quot;ConnectString&quot;))<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SQL = &quot;Select * From BIN&quot;<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Dim da As New OracleDataAdapter(SQL, cn)<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Dim dt As New DataTable<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;da.Fill(dt)<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Return dt<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SQL = Nothing<br> &nbsp;&nbsp; &nbsp;End Function</p> <p>Web.config looks like this;</p> <p>&lt;?xml version=&quot;1.0&quot;?&gt;<br> &lt;!--<br> &nbsp; For more information on how to configure your ASP.NET application, please visit<br> &nbsp; http://go.microsoft.com/fwlink/?LinkId=169433<br> &nbsp; --&gt;<br> &lt;configuration&gt;<br> &nbsp; &lt;connectionStrings&gt;<br> &nbsp;&nbsp;&nbsp; &lt;add name=&quot;ApplicationServices&quot; connectionString=&quot;data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true&quot; providerName=&quot;System.Data.SqlClient&quot;/&gt;<br> &nbsp; &lt;/connectionStrings&gt;<br> &nbsp; &lt;system.web&gt;<br> &nbsp;&nbsp;&nbsp; &lt;compilation debug=&quot;true&quot; strict=&quot;false&quot; explicit=&quot;true&quot; targetFramework=&quot;4.0&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;assemblies&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add assembly=&quot;Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89B483F429C47342&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add assembly=&quot;System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add assembly=&quot;System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add assembly=&quot;System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/assemblies&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/compilation&gt;<br> &nbsp;&nbsp;&nbsp; &lt;authentication mode=&quot;Forms&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;forms loginUrl=&quot;~/Account/Login.aspx&quot; timeout=&quot;2880&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/authentication&gt;<br> &nbsp;&nbsp;&nbsp; &lt;membership&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;providers&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;clear/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name=&quot;AspNetSqlMembershipProvider&quot; type=&quot;System.Web.Security.SqlMembershipProvider&quot; connectionStringName=&quot;ApplicationServices&quot; enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;true&quot; requiresQuestionAndAnswer=&quot;false&quot; requiresUniqueEmail=&quot;false&quot; maxInvalidPasswordAttempts=&quot;5&quot; minRequiredPasswordLength=&quot;6&quot; minRequiredNonalphanumericCharacters=&quot;0&quot; passwordAttemptWindow=&quot;10&quot; applicationName=&quot;/&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/providers&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/membership&gt;<br> &nbsp;&nbsp;&nbsp; &lt;profile&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;providers&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;clear/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name=&quot;AspNetSqlProfileProvider&quot; type=&quot;System.Web.Profile.SqlProfileProvider&quot; connectionStringName=&quot;ApplicationServices&quot; applicationName=&quot;/&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/providers&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/profile&gt;<br> &nbsp;&nbsp;&nbsp; &lt;roleManager enabled=&quot;false&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;providers&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;clear/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name=&quot;AspNetSqlRoleProvider&quot; type=&quot;System.Web.Security.SqlRoleProvider&quot; connectionStringName=&quot;ApplicationServices&quot; applicationName=&quot;/&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name=&quot;AspNetWindowsTokenRoleProvider&quot; type=&quot;System.Web.Security.WindowsTokenRoleProvider&quot; applicationName=&quot;/&quot;/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/providers&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/roleManager&gt;<br> &nbsp; &lt;/system.web&gt;<br> &nbsp; &lt;system.webServer&gt;<br> &nbsp;&nbsp;&nbsp; &lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;/&gt;<br> &nbsp; &lt;/system.webServer&gt;<br> &lt;/configuration&gt;</p> <p>Any help is greatly appreciated, thanks!</p> 2012-05-17T14:09:13-04:004985591http://forums.asp.net/p/1804779/4985591.aspx/1?Re+Problem+with+VS2010+suddenly+not+knowing+what+a+DataTable+is+Re: Problem with VS2010 suddenly not knowing what a DataTable is. <p>Try to import data namespace</p> <p><strong>Imports System.Data</strong></p> 2012-05-17T14:37:33-04:004985597http://forums.asp.net/p/1804779/4985597.aspx/1?Re+Problem+with+VS2010+suddenly+not+knowing+what+a+DataTable+is+Re: Problem with VS2010 suddenly not knowing what a DataTable is. <p>BIN might be a RESERVED WORD in Oracle and causes problems in various circumstances.</p> <p>Oracle ODP.NET often wants the SCHEMANAME with database object names.</p> <p>Like MYSCHEMA.MYTABLE, MYSCHEMA.MYSEQUENCE, MYSCHEMA.MYPACKAGE.</p> <p>&nbsp;</p> 2012-05-17T14:38:52-04:004985650http://forums.asp.net/p/1804779/4985650.aspx/1?Re+Problem+with+VS2010+suddenly+not+knowing+what+a+DataTable+is+Re: Problem with VS2010 suddenly not knowing what a DataTable is. <p>Apparently the Oracle.Types namespace no longer includes DataTable.&nbsp; The funny thing is that my other projects still compile and run just fine.</p> 2012-05-17T15:07:06-04:004985657http://forums.asp.net/p/1804779/4985657.aspx/1?Re+Problem+with+VS2010+suddenly+not+knowing+what+a+DataTable+is+Re: Problem with VS2010 suddenly not knowing what a DataTable is. <p>That wasn't the problem but I think that I remember BIN being a reserved word in the older Oracle versions.&nbsp; Now they spell out BINARY so that didn't trip me up this time.</p> 2012-05-17T15:10:11-04:00