Null Reference Exception RRS feed

  • Question

  • User-960441985 posted



    I am working on ArcObjects using Visual Studio 2015.  I am connecting 'sql server' connection and getting System.NullREferenceExpceiotn occureed in MyToolbox.dll. I am using ArcMap 10.6.1.

     Here are steps

    1. Added App.config 

    <add name="SQLserver" connectionString="server=xxx;database=xxx;User Id=xxx;Password=xxx"/>

    2.  Button.vb file

    Dim SqlDB As Object = ConfigurationManager.ConnectionStrings("SQLserver").ConnectionString

    Note: I am able to connect with same credentials as desktop application but it doesn't working as a dll file. Do I require a difference method. 

    Thanks a lot


    Thursday, March 11, 2021 5:21 AM

All replies

  • User-1716253493 posted

    Where you add the line? You must place it in connectionstrings section

    Friday, March 12, 2021 10:09 PM
  • User-960441985 posted

    Thanks for your response. I am using under connectionstrings. Any other reason it is breaking?

    Monday, March 15, 2021 4:14 AM