My report uses COMMAND AS data sourse, and when I change the location of data source in my C# code, I have to assign the myTable.Location property, I found .net read in COMMAND as one table, so, when I assign its location as
MyTable.Location = (string)ConfigurationSettings.AppSettings["databaseName"] + ".dbo." + crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1);
after this statement, Location will be something like SERVERNAME.dbo.COMMAND, and
I get following error message:
System.Runtime.InteropServices.COMException was caught
Message="Failed to load database information.\nDetails: The database DLL 'crdb_query.dll' could not be loaded.\rError in File C:\\DOCUME~1\\Zhiyuan.Li\\LOCALS~1\\Temp\\serviceReport {935100AA-592A-4781-BBAC-9F61FF773FCE}.rpt:\nFailed to load database information."
Source="rptcontrollers.dll"
ErrorCode=-2147482931
however, if I just assign its location property to COMMAND, which is just as how it read in, I got following error message when doing the report export:
CrystalDecisions.CrystalReports.Engine.InternalException was caught
Message="Failed to open a rowset.\nDetails: ADO Error Code: 0x\nSource: Microsoft OLE DB Provider for SQL Server\nDescription: Incorrect syntax near ','.\nSQL State: 42000\nNative Error: \rFailed to open a rowset.\rError in File C:\\DOCUME~1\\Zhiyuan.Li\\LOCALS~1\\Temp\\serviceReport {AAD0566D-162B-482F-8035-90B39BED5B9C}.rpt:\nFailed to open a rowset."
Source="CrystalDecisions.ReportAppServer.DataSetConversion"
StackTrace:
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
at ReportsForServiceProvider.ReportManager.SaveAsPDF(ReportDocument aReport, String spName) in C:\Documents and Settings\Zhiyuan.Li\My Documents\Visual Studio 2005\Projects\ReportsForServiceProvider\ReportsForServiceProvider\ReportManager.cs:line 242
Can anyone give me a hint on what I should do with Command when assigning Location property?
Thanks
Zhiyuan