Asked by:
IsDBNull not working in class when in App_Code folder

Question
-
User1935984934 posted
I am cleaning up my code and found out that some codes are not running when the class is moved into the App_Code folder.For example IsDBNull .. Chrw ... and IsNothing all statements are working fine when the class is outside the App_Code folder See print screen below
Friday, June 8, 2018 4:58 PM
All replies
-
User475983607 posted
You're missing references.
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.isdbnull(v=vs.110).aspx
Click on the help icon to the left of the error for assistance.
Friday, June 8, 2018 5:22 PM -
User1120430333 posted
Most likely, there is no import statement for the Microsoft.VisualBasic namespace in the class or classes when it/they are moved to the App_Code folder. As opposed to when the classes are not in App_Code folder, Microsoft.VisualBasic namespace is known by your solution if the import for namespace Microsoft.VisualBasic is not present in the class or classes.
What's the purpose of you trying to use the App-Code folder anyway? Are you trying to come up with some kind of VB.NET module like coding thing?
Friday, June 8, 2018 9:01 PM -
User1935984934 posted
What's the purpose of you trying to use the App-Code folder anyway? Are you trying to come up with some kind of VB.NET module like coding thing?No, I just thought that the App_Code folder should be used to store no form related elements.
Tuesday, July 3, 2018 1:28 PM -
User36583972 posted
Hi Corobori,In a Web site project, you can store source code in the App_Code folder, and it will be automatically compiled at run time. The resulting assembly is accessible to any other code in the Web application. The App_Code folder therefore works much like the Bin folder, except that you can store source code in it instead of compiled code. The App_Code folder and its special status in an ASP.NET Web application makes it possible to create custom classes and other source-code-only files and use them in your Web application without having to compile them independently.
You can refer the following articles.
A Beginner's Guide to ASP.NET Application Folders
https://www.codeproject.com/Articles/31557/A-Beginner-s-Guide-to-ASP-NET-Application-FoldersApp_Code folder doesn’t work with Web Application Projects (WAPs):
http://vishaljoshi.blogspot.com/2009/07/appcode-folder-doesnt-work-with-web.html
Best Regards,Yong Lu
Thursday, July 5, 2018 7:26 AM