Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

System.Data; and System.Data.SqlServerCe; references

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

    System.Data; and System.Data.SqlServerCe; references

    Dear support –
    I understand that you said my issue is unsupported but anyway. We are quite a long time together. You help me many times and gave me helpful advises even then the issue was outside support.

    My problem is connecting to NinjaTrader.sdf file. I did it sometime, but now it doesn’t work.

    My script create external windows form and put data from NinjaTrader.sdf on it.
    In my script I use the following declarations
    Using System.Data;
    Using System.Data.SqlServerCe;
    Then I made reference by clicking References -> Add (chose System.Data.SqlServerCe.dll in Program Files (86) -> NinjaTrader7 -> bin…) click ok

    Then I made reference to System.Data.dll by the same actions but chose the file from the subfolder WINDOWS in my computer which ends to v.4.0. I think it is the version.
    But the script returned the compilation errors anyway.

    Then I found System.Data.dll file of 2.0.0.0 version in the Internet downloaded it and made the reference to the System.Data.dll version 2.0.0.0 file and the script worked.

    But the next time I launched the Ninja, the script did not work again.

    My script should create the external windows form by clicking on custom button on a chart controls panel. Now nothing has happened when I click the button. No any compilation errors are returned when I compiling the script.

    The same situation was before I made new reference to System.Data.dll version 2.0.0.0 file. Nothing had happened by clicking the button.
    I tried to make new references to different files but nothing helps.

    People, I think the answer is in the area of declarations, references and *.dll files versions. I am new in c# codding and will appreciate any advice.

    Bertrand, you always helped me. Please, what is the solution can be.

    Regards.

    #2
    Hi Alex, would you mind sending me that script to support so I could give it a quick look? 4.0 I would not expect to work as reference, but the 2.0 framework should be installed natively on your machine as well, so I would pick the reference needed from this one.

    Should be under the C:\Windows\Microsoft.NET\Framework\v2.0.50727

    Comment


      #3
      Bertrand --

      here is the script

      Regards

      Comment


        #4
        sorry,

        now i attached it
        Attached Files

        Comment


          #5
          Seems to compile and work ok here with the Data.dll from the framework 2.0 and SQL ce as shipped by NT (C:\Program Files (x86)\NinjaTrader 7\bin64).

          What still needs work is closing the form down and proper handling of all custom resources in OnTermination(). If I now close the chart with your study down, the form will stay opend and produce an empty object reference error in the log tab.

          Hope that helps.

          Comment


            #6
            Hi Bertrand,

            seems the script works on your machine. I still have nothing by clicking the button. I guess the problem is with my operation system. What could help? Should I reinstall sql server or something?

            Regards.

            Comment


              #7
              There are still some issues to be addressed with the script, but the basic ops seem ok here (raising the form with the click of a button and getting some db info). Did you update / readd your references fresh to the versions I used?

              System Data from .NET 2.0 and the SQL directly from NT's Program Files > Bin folder.

              Comment


                #8
                yes. I did. here is my referenses window
                Attached Files

                Comment


                  #9
                  Thanks, mine looks the same except no Entity one, think you can remove that. So in your actual used file you did point to the correct sdf folder instead of the GGG placeholder, right?

                  Comment


                    #10
                    I removed Entity one. I created "ggg" folder on c:\\ drive and copied NinjaTrader.sdf from C:\Users\alex.bbfg\Documents\NinjaTrader 7\db

                    I tried to use file drom C:\Users\alex.bbfg\Documents\NinjaTrader 7\db (SqlCeConnection conn = new SqlCeConnection("Data Source=\"C:\\Users\\alex.bbfg\\Documents\\NinjaTra der 7\\db\\NinjaTrader.sdf\"") No result.

                    I remembered that the script stoped work after I installed SDF Veiwer (http://sdf-viewer.soft112.com/) and opend NinjaTrader.sdf by it. I removed the viewer but it still not works.

                    The other thing I noted is that I can not change the instrument of the chart script attached after I ckick the button. The screen of the chart attached. But if I put the intional instrument the chart is ok.

                    May be these things are important and could help.
                    Attached Files

                    Comment


                      #11
                      Thanks Alex, only thought I would have then is perhaps the viewer did change some of your SQL CE config on the system? Perhaps recheck things after a repair install of SQL CE 4 would be fruitful?

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      558 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      324 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      101 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      545 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      547 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X