Dear all,
Now, I want to have a set of reports with same format driving data from
different DB.
So I set the code in ReportDocument like follow:
....
ReportTemp.Load(_report)
For Each table In ReportTemp.Database.Tables
If table.Location.ToUpper.Substring(0, 7) = "DTS_SEA" Then
table.Location =
String.Concat(pPrintSetting.DatabaseName, ".dbo.",
table.LogOnInfo.TableName)
End If
logoninfo = table.LogOnInfo
With logoninfo.ConnectionInfo
.ServerName = pPrintSetting.ServerName
.DatabaseName = pPrintSetting.DatabaseName
.UserID = pPrintSetting.UserID
.Password = pPrintSetting.Password
End With
table.ApplyLogOnInfo(logoninfo)
Next table
....
I would like to ask what is the purpose of table.Location. When I check
the value of it, it show "DatabaseA.dbo.tablename". So I try to change it to
"DatabaseB.dbo.tablename" but it fails.
The error message is "invalid table number." What this means?
Please help.
Thanks a lot,
Ray