DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

How to run DataProvider.Instance().ExecuteReader without ObjectQualifier

 4 Replies
 1 Subscribed to this topic
 23 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 19
New Around Here

    Hi,

    I've an old DNN that use ObjectQualifier and been upgrade to latest DNN, the previous developer create some complex StoreProcedured that doesn't use ObjectQualifier.

    Because of performance issue, to speed up I try to run it with DataReader:

    `var completeCourses = CBO.FillCollection(DataProvider.Instance().ExecuteReader(SP_CompletedCourse, userIds, timePeriodId);`

    The problem with code above, it looking for StoreProcedure with ObjectQualifier `{objectQualifier}SP_CompletedCourse` that not exist.

    Is it possible to ExecuteReader without {objectQualifier} ?
    If it not possible, I probably will end up duplicate the SP

    Growing Member
    Posts: 111
    Growing Member
      I have only ever worked on 1 website with a objectqualifier, usually it's just empty. I am unsure if you can just ignore an object qualifier is it exists on the database.

      However, I doubt changing the SPROC to use the dataprovider will give you any performance benefit. Usually the speed problem is in the SPROC or table index, If I have to look for performance my first step is always to look at the indexes on the table and is the SPROC using them correctly. After that start looking at the structure of the SPROC, it's amazing how much time you can find with SQL Server.

      Advanced Member
      Posts: 232
      Advanced Member
        Assuming it is DNN DataProvider is aware of the object qualifier and all sql objects should have it.

        The correct answer would be the extension needs to be updated to handle that scenario including it's install/upgrade scripts. You could copy the procedure but any updates to the said module won't be aware that you are using a copy.
        New Around Here
        Posts: 19
        New Around Here
          The original developer create a custom module that not have source code. So update the original module is not possible.
          Tables and store procedure don't have Object Qualifier while the Site it self was using Object Qualifier.

          Because there's so many data and a complex SP, DAL 2 was taking a bit of time, wonder if it because of reflection.
          Use DataReader and simple populate IList of object speed up a bit.

          I ended up duplicate and simplify the SP, as the old SP might still use somewhere else.
          Growing Member
          Posts: 111
          Growing Member
            I have seen cases where the developer has done a lot of manipulation with Linq after the data is returned, which is not a bad idea, but large amounts of data can give some issues in performance. If that is the case, without the source code your going to find it difficult to get more improvement.

            These Forums are dedicated to the discussion of DNN Platform.

            For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

            1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
            2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
            3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
            4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
            5. No Flaming or Trolling.
            6. No Profanity, Racism, or Prejudice.
            7. Site Moderators have the final word on approving / removing a thread or post or comment.
            8. English language posting only, please.

            Would you like to help us?

            Awesome! Simply post in the forums using the link below and we'll get you started.

            Get Involved