Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

DataSetExtensions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DataSetExtensions

    I'm trying to use DataTable() in my script. This appears to mean putting "using System.Data;" and "using System.Data.DataSetExtensions;" into the code as well as in the "References". Of course, I've done both. However, when I compile I get the following error: "The type or namespace name 'System.Data.DataSetExtensions' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)".

    fwiw, .NET 4.7 is currently installed in my system.

    Any suggestions as to how to fix this?

    #2
    Hello spottysallrite,

    Thank you for the question.

    In references to the .net version, if you are manually referencing any system .net dlls, please ensure to use .net 4.5 for NT8. 4.7 would not be supported currently.

    You may also need to copy the .dll files to the Documents\NinjaTrader 8\bin\Custom folder for them to be correctly compiled, this would also entail you update the reference to point to this folder.

    If you have visual studio installed, a quick way to gather .net dll references would be to create a new empty WPF application project targeting .net 4.5. In the project, you can manage the references as needed and then build the project. This will cause the dlls to be copied to the output folder which you can then copy to the bin/custom folder and reference.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I'm not following. References already points to System.Data and System.DatSetExtensions. Both are in .NETFramework\v4.5. Are you saying I need to copy those files to bin\Custom as well, and have References point to them there as well ?

      Comment


        #4
        Hello spottysallrite,

        Yes, this is correct, files that are outside of the bin/custom folder may fail to be seen by the compiler correctly when referenced. It is advisable to place all references in the bin/custom folder.

        You would likely need to remove the references you have now, compile and exit, add the files to the custom folder and then restart/reference/compile with them in the custom folder. The existing system dll references are added in a special way in the config file which allows the GAC to provide the correct .dll file. For other files you manually add, generally, these need to be placed in the custom folder.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          FWIW I tried adding System.Data as a reference via NinjaScript Indicator Window | Selected Reference | Selected Add | Navigated to the File. NT8 did not like this when I tried to compile an indicator. Numerous errors with stock NT indicators. Removed the reference and compiled it again. No errors.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          6 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Started by alifarahani, Today, 09:40 AM
          6 responses
          41 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          20 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Working...
          X