title: Setting Connection attributes for DataDefModel.PropertyBag in Crystal Reports to connect to SQL Express 2005/2008
body: <p>How should I modify the below code so that I can use these connection attributes to connect to a Microsoft sql express 2005 or 2008 database</p>
  
  <pre><code> CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag connectionAttributes = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
          connectionAttributes.EnsureCapacity(11);
          connectionAttributes.Add("Connect Timeout", "15");
          connectionAttributes.Add("Data Source", serverName);
          connectionAttributes.Add("General Timeout", "0");
          connectionAttributes.Add("Initial Catalog", databaseName);
          connectionAttributes.Add("Integrated Security", false);
          connectionAttributes.Add("Locale Identifier", "1033");
          connectionAttributes.Add("OLE DB Services", "-5");
          connectionAttributes.Add("Provider", "SQLOLEDB");
          connectionAttributes.Add("Tag with column collation when possible", "0");
          connectionAttributes.Add("Use DSN Default Properties", false);
          connectionAttributes.Add("Use Encryption for Data", "0");
  
          DbConnectionAttributes attributes = new DbConnectionAttributes();
          attributes.Collection.Add(new NameValuePair2("Database DLL", "crdb_ado.dll"));
          attributes.Collection.Add(new NameValuePair2("QE_DatabaseName", databaseName));
          attributes.Collection.Add(new NameValuePair2("QE_DatabaseType", "OLE DB (ADO)"));
          attributes.Collection.Add(new NameValuePair2("QE_LogonProperties", connectionAttributes));
          attributes.Collection.Add(new NameValuePair2("QE_ServerDescription", serverName));
          attributes.Collection.Add(new NameValuePair2("SSO Enabled", false));
  
          ConnectionInfo connectionInfo =GetConnectionInfo(serverName, databaseName, userID, password);
          connectionInfo.Attributes = attributes;
          connectionInfo.Type = ConnectionInfoType.SQL;
  </code></pre>