How to change database name dynamically in Crystal Report

I had a crystal report which is called within C# to generate a pdf file.

While deploying i had to change the db name. How to change the database name without changing the database info in the report itself

This will not work: repDoc.SetDatabaseLogon(db_username, db_password, server_name, database_name);

Use this       

    repDoc.Load(repFilePath);

            TableLogOnInfo logonInfo = new TableLogOnInfo();
            foreach (Table table in repDoc.Database.Tables)
            {
                logonInfo = table.LogOnInfo;
                logonInfo.ConnectionInfo.ServerName = db_dsn_name;
                logonInfo.ConnectionInfo.DatabaseName = db_database_name;
                logonInfo.ConnectionInfo.UserID = db_username;
                logonInfo.ConnectionInfo.Password = db_password;
                table.ApplyLogOnInfo(logonInfo);
            }

Important Point to Note: I used odbc in the report. So the Servername above should be the name of the DSN.