Rohit Sharma Rohit Sharma - 1 year ago 356
ASP.NET (C#) Question

Untrusted Initialization - VeraCode Scan Issue

I am getting one High veracode scan issue in the below code. What changes do i need to make to resolve it.

private OleDbConnection importFileConnection;
private OleDbConnection ImportFileConnection
if (importFileConnection == null)
{ importFileConnection = new OleDbConnection(this.ConnectionString);
//getting scan issue in this line. }
return importFileConnection;

private string ConnectionString
get { return string.Format(ImportExportData.Default.ConnectionString, this.ServerFileName); }

Answer Source

String.format is the issue. declare connection with out connection string, then mention the connection property.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download