title: SAP Hard-coded logon parameters not allowed when using a Destination Configuration in C#
body: <p>When i try to connect to SAP server dynamically I am getting error like  </p>
  
  <p>Hard-coded logon parameters not allowed when using a Destination Configuration</p>
  
  <p>any one plz help me </p>
  
  <p>I need to send all parameters from codebehind Dynamically not from Web.config</p>
  
  <p>from web.config its working fine .. but not here </p>
  
  <p>My code is like this </p>
  
  <pre><code>            SAPSystemConnect objSapConfig = new SAPSystemConnect();
              RfcDestination objSapdestination = null;
  
              RfcDestinationManager.RegisterDestinationConfiguration(objSapConfig);
  
              RfcConfigParameters objParameter = new RfcConfigParameters();
              objParameter.Add(RfcConfigParameters.AppServerHost, Convert.ToString("XXX"));
              objParameter.Add(RfcConfigParameters.Client, Convert.ToString("XXX"));
              objParameter.Add(RfcConfigParameters.Password, Convert.ToString("XXX"));
              objParameter.Add(RfcConfigParameters.SystemNumber, Convert.ToString("XXX"));
              objParameter.Add(RfcConfigParameters.User, Convert.ToString("XXX"));
              objParameter.Add(RfcConfigParameters.Language, Convert.ToString("XXX"));
              objParameter.Add(RfcConfigParameters.LogonGroup, Convert.ToString("XXX"));
  
              objParameter.Add(RfcConfigParameters.PoolSize, Convert.ToString("XXX"));
              objParameter.Add(RfcConfigParameters.PeakConnectionsLimit, Convert.ToString("5"));
              objParameter.Add(RfcConfigParameters.IdleTimeout, Convert.ToString("XXX"));
              //objParameter.Add(RfcConfigParameters.Name, Convert.ToString("XXX"));
  
  
  
              objSapdestination = RfcDestinationManager.GetDestination(objParameter);
              RfcCustomDestination customDest = objSapdestination.CreateCustomDestination();
              IRfcFunction func = customDest.Repository.CreateFunction("XXX");
  
  
  
  
              RfcRepository objSapRepository = objSapdestination.Repository;
  
              // Calling Sap Function
              IRfcFunction objSapDataFunction = objSapRepository.CreateFunction(Convert.ToString("XXX"));
  
              objSapDataFunction.SetValue("XXX", "XXX");
  
              objSapDataFunction.Invoke(objSapdestination);
  
              // Filling SapData into Table
              IRfcTable objSapTable = objSapDataFunction.GetTable(Convert.ToString("GIT_DATA"));
  </code></pre>