ObjectDataSource can't see business objects in app_code

Last post 09-08-2009 10:22 AM by mledbetter. 25 replies.

Sort Posts:

  • Re: ObjectDataSource can't see business objects in app_code

    05-21-2007, 2:53 PM
    • Member
      4 point Member
    • NukeAlexS
    • Member since 05-21-2007, 6:43 PM
    • Posts 2

    Have exactly the same issue here:
    (http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/136089/scope/posts/Default.aspx)

    Anyone found a solution (not having fun either :).
    (http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/136089/scope/posts/Default.aspx)

    Many thanks...!

     p.s.

    My code is as below

    <ComponentModel.DataObjectAttribute()> _ ' Not sure if this line is needed or not, doesn't work either way anyway
    Public Class WebsiteDirectoryController

    <ComponentModel.DataObjectMethod(ComponentModel.DataObjectMethodType.Insert, True)> _
    Public Shared Sub WebsiteDetails_Insert(ByVal WebsiteDirectoryInfo As WebsiteDirectoryInfo)DataProvider.Instance().ExecuteNonQuery("WebsiteDetails_Insert", WebsiteDirectoryInfo.ModuleId, _

    GetNull(WebsiteDirectoryInfo.CreatedByUser), WebsiteDirectoryInfo.CreatedDate, GetNull(WebsiteDirectoryInfo.CreatedByUserName), _

    GetNull(WebsiteDirectoryInfo.SiteURL), GetNull(WebsiteDirectoryInfo.SiteThumbnailURL), GetNull(WebsiteDirectoryInfo.SiteName), _

    GetNull(WebsiteDirectoryInfo.SiteDescription))

    End Sub

    <ComponentModel.DataObjectMethod(ComponentModel.DataObjectMethodType.Delete, True)> _
    Public Shared Sub WebsiteDetails_Delete(ByVal WebsiteDirectoryInfo As WebsiteDirectoryInfo) DataProvider.Instance().ExecuteNonQuery("WebsiteDetails_Delete", WebsiteDirectoryInfo.ItemId)

    End Sub

    <ComponentModel.DataObjectMethod(ComponentModel.DataObjectMethodType.Update, True)> _
    Public Shared Sub WebsiteDetails_Update(ByVal WebsiteDirectoryInfo As WebsiteDirectoryInfo)DataProvider.Instance().ExecuteNonQuery("WebsiteDetails_Insert", WebsiteDirectoryInfo.ItemId, WebsiteDirectoryInfo.ModuleId, _

    GetNull(WebsiteDirectoryInfo.CreatedByUser), WebsiteDirectoryInfo.CreatedDate, GetNull(WebsiteDirectoryInfo.CreatedByUserName), _

    GetNull(WebsiteDirectoryInfo.SiteURL), GetNull(WebsiteDirectoryInfo.SiteThumbnailURL), GetNull(WebsiteDirectoryInfo.SiteName), _

    GetNull(WebsiteDirectoryInfo.SiteDescription))

    End Sub

    <ComponentModel.DataObjectMethod(ComponentModel.DataObjectMethodType.Select, True)> _
    Public Shared Function WebsiteDetails_SelectAll(ByVal ModuleId As Integer) As List(Of WebsiteDirectoryInfo) Return CBO.FillCollection(Of WebsiteDirectoryInfo)(CType(DataProvider.Instance().ExecuteReader("WebsiteDirectoryInfo_SelectAll", ModuleId), IDataReader))

    End Function

    End Class

  • Re: ObjectDataSource can't see business objects in app_code

    06-10-2007, 7:49 AM

     Hi all

     I am having the same problem but with ajax enabled or toolkit site. If I use a normal asp.net web site (Template) it works fine. I only have an App_Code folder.

     

  • Re: ObjectDataSource can't see business objects in app_code

    07-02-2007, 8:34 AM
    • Member
      11 point Member
    • ryurdiga
    • Member since 03-24-2007, 4:33 AM
    • Posts 17

     

    wstevens@vodamail.co.za:

     Hi all

     I am having the same problem but with ajax enabled or toolkit site. If I use a normal asp.net web site (Template) it works fine. I only have an App_Code folder.

     

     

    I was also haveing the same issue, for about 10 hours i was trying to figure out why my app_code wasn't working like before (ajax enable website). So after banging my head reading millions of post i finally came across this, then i got an idea. I put a .vb class file in the root directory, i was able to access my classes. I like to keep the project clean, so i added a folder called classes(which is what i would put all my stuff in that normally i put in app_code) and added in my class file. without a problem the fricken thing worked. big sye of relief. So i figured i would just publish it, just to see what VS does with the folder. Sure enough it musta put in in a DLL, cause the damn thing worked.

     

    I hope this solves peoples problems cause i fustraded me like crazy

     

    ryurdiga 

  • Re: ObjectDataSource can't see business objects in app_code

    08-31-2007, 7:17 AM
    • Member
      24 point Member
    • Avy
    • Member since 05-18-2007, 12:38 PM
    • Posts 7

    I believe when you add a class in App-Code it somehow feels the class as a content file. So if you see the properties of the file and change the build action to compile then I believe it would work.

     

    Cheers,

    Avy

  • Re: ObjectDataSource can't see business objects in app_code

    10-31-2007, 6:42 AM
    • Member
      2 point Member
    • dahanmeir
    • Member since 10-31-2007, 10:40 AM
    • Posts 1

    All you need to do is to complie the project and then you will see your classes in the drop down.

  • Re: ObjectDataSource can't see business objects in app_code

    11-26-2007, 10:01 AM
    • Member
      4 point Member
    • Nurmuhamed
    • Member since 11-26-2007, 2:25 PM
    • Posts 2

    I also tried all suggestions in this forum. Finally, I came up with a following.
    All you need to do is to change the configuration within the web.config file:

    Find the following directive: 

    <codeSubDirectories>
            <add directoryName="HTML" />
            <add directoryName="whatever_directory_that_is_causing_troubles" />
    </codeSubDirectories>

     and add the line that I marked in bold.

    Then "save all" and compile the project.

     

    <<It's always a long day, 86'400 won't fit into a short>>
  • Re: ObjectDataSource can't see business objects in app_code

    01-28-2008, 4:07 AM
    • Member
      2 point Member
    • Scaprio
    • Member since 01-28-2008, 8:55 AM
    • Posts 1

     Hi,

     And what should that directory be then, an example would be nice.

  • Re: ObjectDataSource can't see business objects in app_code

    01-28-2008, 4:54 AM
    • Member
      4 point Member
    • Nurmuhamed
    • Member since 11-26-2007, 2:25 PM
    • Posts 2

    Please take a look into your error. It should be right there.

    Nur 


    <<It's always a long day, 86'400 won't fit into a short>>
  • Re: ObjectDataSource can't see business objects in app_code

    12-02-2008, 11:37 AM
    • Member
      2 point Member
    • arpr89
    • Member since 08-18-2006, 7:05 PM
    • Posts 1

    I had the same problem. Here is the solution. Enjoy!

    http://adefwebserver.com/DotNetNukeHELP/DNN_Things4Sale/ThingsForSale3.htm

  • Re: ObjectDataSource can't see business objects in app_code

    08-25-2009, 10:03 AM
    • Member
      4 point Member
    • jimthespider
    • Member since 07-30-2009, 1:07 PM
    • Charlotte
    • Posts 9

    ryurdiga:

     

    wstevens@vodamail.co.za:

     Hi all

     I am having the same problem but with ajax enabled or toolkit site. If I use a normal asp.net web site (Template) it works fine. I only have an App_Code folder.

     

     

    I was also haveing the same issue, for about 10 hours i was trying to figure out why my app_code wasn't working like before (ajax enable website). So after banging my head reading millions of post i finally came across this, then i got an idea. I put a .vb class file in the root directory, i was able to access my classes. I like to keep the project clean, so i added a folder called classes(which is what i would put all my stuff in that normally i put in app_code) and added in my class file. without a problem the fricken thing worked. big sye of relief. So i figured i would just publish it, just to see what VS does with the folder. Sure enough it musta put in in a DLL, cause the damn thing worked.

     

    I hope this solves peoples problems cause i fustraded me like crazy

     

    ryurdiga 

     

     

    Could you elaborate on what you describe here?  I know this was a long time ago but this sounds like a problem I am having now.  I have an AJAX web site that was working fine with my classes in App_code until I added the timer control (AJAX Extensions) then my project when compiled won't recognize my SessionHandler.vb class in the App_code folder.  Are you saying you added a folder (not asp.net folder) to the root of your project and then moved your classes into it and then your project recognized your classes?

  • Re: ObjectDataSource can't see business objects in app_code

    09-08-2009, 10:22 AM
    • Member
      2 point Member
    • mledbetter
    • Member since 09-17-2007, 4:24 PM
    • Posts 1

    Three steps to correct this whole problem.

    1. Go ahead and create the folder App_Code.  Create the class files or add the class files that you want to compile as your business objects in your AJAX Web Application. 

    2. Make sure the namespace in your class files is correct for each file.  Remove any ".App_Code" extensions.

    3. Set each class file to "compile" in the properties for that class file.  You can see this option by clicking the class file, viewing the properties in the properties explorer window, and changing the Build Action dropdown list to "Compile."

     

    Best of luck,

    Matt

Page 2 of 2 (26 items) < Previous 1 2