Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

using System.Data

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

    using System.Data

    In NinjaScript, am I able to use System.Data?

    using System;
    using System.Data;

    It didn't appear in the list of references.

    #2
    You can use any valid .NET namespace. In the editor, just type "System." excluding quotations to confirm.
    RayNinjaTrader Customer Service

    Comment


      #3
      Hmmm... System.Data is the only one that doesn't confirm.

      In Visual Studio, I can confirm the following:

      using System;
      using System.CodeDom;
      using System.Collections;
      using System.ComponentModel;
      using System.Configuration;
      using System.Data;
      using System.Deployment;
      using System.Diagnostics;
      using System.Drawing;
      using System.Globalization;
      using System.IO;
      using System.Media;
      using System.Net;
      using System.Reflection;
      using System.Resources;
      using System.Runtime;
      using System.Security;
      using System.Text;
      using System.Threading;
      using System.Timers;
      using System.Web;
      using System.Windows;
      using System.Xml;

      In NinjaTrader, I can confirm the following. Notice that System.Data is not on the list.

      using System;
      using System.CodeDom;
      using System.Collections;
      using System.ComponentModel;
      using System.Configuration;
      using System.Deployment;
      using System.Diagnostics;
      using System.Drawing;
      using System.Globalization;
      using System.IO;
      using System.Media;
      using System.Net;
      using System.Reflection;
      using System.Resources;
      using System.Runtime;
      using System.Security;
      using System.Text;
      using System.Threading;
      using System.Timers;
      using System.Web;
      using System.Windows;
      using System.Xml;

      Any ideas why?

      Comment


        #4
        Not sure I follow.

        Just add
        using System.Data:
        ... to your NinjaScript code and you should be good.

        Note: We do not provide support for using VS for editing NS files. Please use the NT built-in editor.

        Comment


          #5
          using System.Data;
          using System.Data.SqlClient;

          SqlCommand myCommand = new SqlCommand();

          When I compile, it raises an compile error, "The type of namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)"

          Comment


            #6
            You likely will need to add references by right click->References. Please consult the Microsoft documentation for details on which assemblies etc.

            Unfortunately this is beyond what we can provide support for.

            Comment


              #7
              To fix the problem, I modified the Config.xml file.

              BEFORE

              <NinjaTrader>
              <Options>
              <InstalledAt>
              <dateTime>2008-04-15T10:42:36.4000784-07:00</dateTime>
              </InstalledAt>
              <References>
              <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
              <string>System.dll</string>
              <string>System.Drawing.dll</string>
              <string>System.XML.dll</string>
              <string>System.Windows.Forms.dll</string>
              <string>C:\Program Files\NinjaTrader 6.5\bin\NinjaTrader.Core.dll</string>
              <string>C:\Program Files\NinjaTrader 6.5\bin\WilsonORMapper.dll</string>
              <string>C:\Documents and Settings\test\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Vendor.dll</string>
              </ArrayOfString>
              </References>

              AFTER (added System.Data.dll to the list of References)

              <NinjaTrader>
              <Options>
              <InstalledAt>
              <dateTime>2008-04-15T10:42:36.4000784-07:00</dateTime>
              </InstalledAt>
              <References>
              <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
              <string>System.dll</string>
              <string>System.Data.dll</string>
              <string>System.Drawing.dll</string>
              <string>System.XML.dll</string>
              <string>System.Windows.Forms.dll</string>
              <string>C:\Program Files\NinjaTrader 6.5\bin\NinjaTrader.Core.dll</string>
              <string>C:\Program Files\NinjaTrader 6.5\bin\WilsonORMapper.dll</string>
              <string>C:\Documents and Settings\test\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Vendor.dll</string>
              </ArrayOfString>
              </References>

              Rebooted NinjaTrader and viola!
              Last edited by mgbloomfield; 04-17-2008, 11:38 AM.

              Comment


                #8
                a) sorry, in your post System.Data.dll is included in the BEFORE image
                b) you NEVER should edit the Config.xml, since this easily could screw up your installation but add any/delete reference by my post below (NinjaScript editor->Right click->References)

                Comment


                  #9
                  It wasn't clear to me if add/remove References (NinjaScript editor->Right click->References) would apply to all NinjaScripts or apply only to the specific indicator.

                  I fixed my post.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by AttiM, 02-14-2024, 05:20 PM
                  12 responses
                  213 views
                  0 likes
                  Last Post DrakeiJosh  
                  Started by cre8able, 02-11-2023, 05:43 PM
                  3 responses
                  238 views
                  0 likes
                  Last Post rhubear
                  by rhubear
                   
                  Started by frslvr, 04-11-2024, 07:26 AM
                  8 responses
                  117 views
                  1 like
                  Last Post NinjaTrader_BrandonH  
                  Started by stafe, 04-15-2024, 08:34 PM
                  10 responses
                  47 views
                  0 likes
                  Last Post stafe
                  by stafe
                   
                  Started by rocketman7, Today, 09:41 AM
                  3 responses
                  12 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X