title: Error 10061 - Connecting to SAP from .Net
body: <p>I am trying to connect to SAP database from .Net application. I want to fetch a list of products from SAP database. I know nothing about SAP, trying to communicate using SAP.Net connector.</p>
  
  <p>I am not able to establish connection with SAP database successfully, getting <code>Error 10061 WSAECONNREFUSED</code>. I've disabled firewall as well.</p>
  
  <p>I've configured my App.config as below.</p>
  
  <pre><code> &lt;configuration&gt;
  
     &lt;configSections&gt;
       &lt;sectionGroup name="SAP.Middleware.Connector"&gt;
         &lt;sectionGroup name="ClientSettings"&gt;
           &lt;section name="DestinationConfiguration" type="SAP.Middleware.Connector.RfcDestinationConfiguration, sapnco"/&gt;
         &lt;/sectionGroup&gt;
       &lt;/sectionGroup&gt;   &lt;/configSections&gt;
  
     &lt;SAP.Middleware.Connector&gt;    
       &lt;ClientSettings&gt;
         &lt;DestinationConfiguration&gt;
           &lt;destinations&gt;
             &lt;add NAME="DEV" USER="username" PASSWD="password" CLIENT="000"
                  LANG="EN" ASHOST="127.0.0.1" SYSNR="00"
                  MAX_POOL_SIZE="10" IDLE_TIMEOUT="10"/&gt;
           &lt;/destinations&gt;
         &lt;/DestinationConfiguration&gt;
       &lt;/ClientSettings&gt;   &lt;/SAP.Middleware.Connector&gt;
        &lt;startup&gt;
       &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;   &lt;/startup&gt;
  
   &lt;/configuration&gt;
  </code></pre>
  
  <p>Code in code is as below</p>
  
  <pre><code> RfcDestination SapRfcDestination = RfcDestinationManager.GetDestination("DEV");
  
   RfcRepository SapRfcRepository = SapRfcDestination.Repository;
  </code></pre>
  
  <p>I get the exception as soon as second statement is executed.</p>
  
  <p>The Exception message is as below</p>
  
  <pre><code>LOCATION    CPIC (TCP/IP) on local host with Unicode
  ERROR       partner 'WIN-FHT4V74IPIN:3300' not reached
  TIME        Tue Dec 31 02:46:24 2013
  RELEASE     720
  COMPONENT   NI (network interface)
  VERSION     40
  RC          -10
  MODULE      nixxi.cpp
  LINE        3286
  DETAIL      NiPConnect2: 192.168.100.123:3300
  SYSTEM CALL connect
  ERRNO       10061
  ERRNO TEXT  WSAECONNREFUSED: Connection refused
  COUNTER     1
  </code></pre>