# GrapeCity.ActiveReports.Design.Designer.LocateCredentials

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="GrapeCity_ActiveReports_Design_Designer_LocateCredentials" data-uid="GrapeCity.ActiveReports.Design.Designer.LocateCredentials" class="text-break">LocateCredentials Event
</h1>
<div class="markdown level0 summary"><p>Occurs when credentials are needed to access a data source. This event facilitates secure credential provision.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.ActiveReports.Design.html">GrapeCity.ActiveReports.Design</a></h6>
<h6><strong>Assembly</strong>: MESCIUS.ActiveReports.Design.Win.dll</h6>
<h5 id="GrapeCity_ActiveReports_Design_Designer_LocateCredentials_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event LocateCredentialsEventHandler LocateCredentials</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.LocateCredentialsEventHandler.html">LocateCredentialsEventHandler</a></td>
      <td>Occurs when credentials are needed to access a data source. This event facilitates secure credential provision.</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Design_Designer_LocateCredentials_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>This event is raised when accessing a data source requires authentication, and credentials are not available or need to be confirmed. It provides a secure way
to request and apply credentials without hard-coding them into the report or application.</p>
<p>Handlers for this event can prompt the user for credentials, retrieve them from a secure store, or apply default credentials based on application logic.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Design_Designer_LocateCredentials_examples"><strong>Examples</strong></h5>
<p>It can be necessary for report preview. Use this event to provide the credentials for the data providers.</p>
<pre><code class="lang-csharp">designer.LocateCredentials += (sender, args) =&gt; {
	args.UserName = "sa";
	args.Password = "12345";
}</code></pre>

</div>
