title: Connection string in the web.config file
body: <p>I am creating a Web API and trying to have the connection string created in the web.config file as</p>
  
  <pre><code>  &lt;connectionStrings&gt;
    &lt;add name="ProConnection" connectionString="Data Source=J;User ID=T;Password=C;pooling=true;min pool size=5;Max Pool Size=60" providerName="Oracle.DataAccess.Client"/&gt;
    &lt;connectionStrings&gt;
  </code></pre>
  
  <p>So I can encrypt the Connection string using aspnet_regiis.exe. So in the controller I am using the below code where dbconn holds the connection details</p>
  
  <pre><code>public HttpResponseMessage Getdetails([FromUri] string[] id)
      { 
       string dbconn = ConfigurationManager.ConnectionStrings["ProConnection"].ConnectionString;
          {
              var inconditions = id.Distinct().ToArray();
              var srtcon = string.Join(",", inconditions);
              DataSet userDataset = new DataSet();
              var strQuery = @"SELECT * from STCD_PRIO_CATEGORY_DESCR where STCD_PRIO_CATEGORY_DESCR.STD_REF IN (" + srtcon + ")";
              OracleCommand selectCommand = new OracleCommand(strQuery, dbconn);
              OracleDataAdapter adapter = new OracleDataAdapter(selectCommand);
              DataTable selectResults = new DataTable();
              adapter.Fill(selectResults);
              string result = JsonConvert.SerializeObject(selectResults);
              string contentDisposition = "inline; filename=abc.json";
              HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, result,     MediaTypeHeaderValue.Parse("application/json"));
              response.Content.Headers.ContentDisposition =  ContentDispositionHeaderValue.Parse(contentDisposition); 
              return response;
         }
     }
  </code></pre>
  
  <p>But I am getting error in the 
  <a href="https://i.stack.imgur.com/YADgW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YADgW.jpg" alt="enter image description here"></a></p>