hi everyone,
i have a crystal reports designed with datasource from ms sql 2008 server on Crystal Reports 2011 . But in runtime there is an option in c# program to use mdb as datasource. Now my question is is there an opportunity to use mdb as datasource to connect this report file? tables names and columns names are identically in mdb and sql db.
here a picture from designmode
and here a line of code i use in runtime for mdb connection but it's not working .
TableLogOnInfo logOnInfo;
ConnectionInfo connectionInfo = new ConnectionInfo();
cryRpt.Load(@"c:\********.rpt");
connectionInfo.Type = ConnectionInfoType.CRQE;
connectionInfo.ServerName = connectionInfo.DatabaseName = @"C:\**************.mdb";
connectionInfo.UserID = null;
connectionInfo.Password = "";
connectionInfo.AllowCustomConnection = false;
connectionInfo.IntegratedSecurity = false;
foreach (Table table in cryRpt.Database.Tables)
{
logOnInfo = table.LogOnInfo;
logOnInfo.ConnectionInfo = connectionInfo;
logOnInfo.TableName = table.Name;
table.ApplyLogOnInfo(logOnInfo);
table.TestConnectivity();
}
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
Any suggestions are welcome
thanks by advance