I am applying the logon information to the report in my application. ON my development machine the information displays fine. On the production machine the Table.TestConnectivity Method always fails. Then the logon screen is displayed with the database, username, and password filled in - but the server is empty and read only. After this the logon always fails. Why would the server be blank? and what could be different on the production machine?
I know that the connection works from the production machine because I am using it for other things in the application also.
ConnectionInfo ci = new ConnectionInfo();
ci.ServerName = server;
ci.DatabaseName = db;
ci.UserID = id;
ci.Password = pass;
....
TableLogOnInfo
li;
// for each table apply connection info
foreach (Table tbl in cr.Database.Tables)
{
li = tbl.LogOnInfo;
li.ConnectionInfo = ci;
tbl.ApplyLogOnInfo(li);
// check if logon was successful
if (tbl.TestConnectivity()) --THIS FAILS
{
// drop fully qualified table location
if (tbl.Location.IndexOf(".") > 0)
{
tbl.Location =
tbl.Location.Substring(tbl.Location.LastIndexOf(
".")
+ 1);
}
else tbl.Location = tbl.Location;
}