Basic approach with Crystal Reports is as follows;
NOTE: Ensure to add references to the following Crystal objects;
CrystalDecisions.CrystalReports.Engine;
CrystalDecisions.Shared;
CrystalDecisions.Web;
a) Load the Report document
ReportDocument crReport = new ReportDocument();
crReport.Load("path and filename");
b) Create a Report connection information object
ConnectionInfo crConn = new ConnectionInfo();
crConn.ServerName = "my db server name";
crConn.DatabaseName = "my database name";
crConn.UserID = "db user name";
crConn.Password = "db password";
c) Apply the Logon information to each report table
Tables tblsReport = crReport.Database.Tables;
for(int i=0; i<tblsreport.count;i++)>
{
Table tblReport = tblsReport[i];
TableLogOnInfo tliTable = tblReport.LogOnInfo;
tliTable.ConnectionInfo = crConn;
tblReport.ApplyLogOnInfo(tliTable);
}