[Need Help]Compare encrypted functions doesn't work
kevinlan
Posts: 11
Error Message :Index was outside the bounds of the array.
System.IndexOutOfRangeException was unhandled
Message="Index was outside the bounds of the array."
Source="RedGate.BackupReader"
StackTrace:
at bV.GetPage(cG pfid, Byte[] targetArray)
at di.<GetHobtRowsFromIAM>d__0.MoveNext()
at di.<GetTableRowsFromIAM>d__e.MoveNext()
at bH.a(String A_1, IEnumerable`1 A_2, IEnumerable`1 A_3)
at bH.PopulateTable(ITableName name, bU pageProvider, bz schemaProvider, aJ tracker)
at RedGate.BackupReader.LiveConnection.PopulateAdditionalSystemTables(List`1 tables)
at RedGate.BackupReader.LiveConnection.PopulateAdditionalSystemTables(ITableName[] tables)
at N..ctor(SqlConnection conn, SQLVersion version)
at w.RedGate.SQLCompare.Engine.IDatabaseHelper.GetEncryptedText(r resultSet, Int32 objectID)
at p.a(o A_1, Boolean A_2)
at p.a(o A_1)
at RedGate.SQLCompare.Engine.Database.Register(ConnectionProperties connectionProperties, Options options)
at Tools.SqlCompareReport.SqlCompareReport.RunCompareRport(Int32 RID, String SourceServer, String SourceDB, String DesServer, String DesDB) in C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\DataBaseTools\SqlCompareReport\SqlCompareReport.cs:line 39
at SqlCompareReport.Program.Main(String[] args) in C:\Documents and Settings\Klan\My Documents\Visual Studio 2008\Projects\DataBaseTools\SqlCompareReport\Program.cs:line 25
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Hi Guys ,i am so lost in this error message .Could someone could help me
when call the register function to Register the database, it raise this error all the same.if there hasn't Encrypted objects, it can work well.
DALCompareReport logreport = new DALCompareReport();
string DifferentType = string.Empty;
string FileName = string.Empty;
Options myoptions = Options.Default | Options.DecryptPost2kEncryptedObjects | Options.IgnorePermissions | Options.IgnoreWhiteSpace | Options.IgnoreUsers;
public void RunCompareRport(int RID,string SourceServer, string SourceDB, string DesServer, string DesDB)
{
using (Database stagingDB = new Database(), productionDB = new Database())
{
//ConnectionProperties sourceConnectionProperties = new ConnectionProperties(Program.StagingServerName, Program.StagingDatabaseName);
// ConnectionProperties targetConnectionProperties = new ConnectionProperties(Program.ProductionServerName, Program.ProductionDatabaseName);
ConnectionProperties sourceConnectionProperties = new ConnectionProperties(SourceServer, SourceDB);
ConnectionProperties targetConnectionProperties = new ConnectionProperties(DesServer, DesDB);
// Connect to the two databases and read the schema
try
{
Console.WriteLine("Registering database " + targetConnectionProperties.DatabaseName + " on server " + DesServer);
productionDB.Register(targetConnectionProperties,myoptions); --error happen in this line
System.IndexOutOfRangeException was unhandled
Message="Index was outside the bounds of the array."
Source="RedGate.BackupReader"
StackTrace:
at bV.GetPage(cG pfid, Byte[] targetArray)
at di.<GetHobtRowsFromIAM>d__0.MoveNext()
at di.<GetTableRowsFromIAM>d__e.MoveNext()
at bH.a(String A_1, IEnumerable`1 A_2, IEnumerable`1 A_3)
at bH.PopulateTable(ITableName name, bU pageProvider, bz schemaProvider, aJ tracker)
at RedGate.BackupReader.LiveConnection.PopulateAdditionalSystemTables(List`1 tables)
at RedGate.BackupReader.LiveConnection.PopulateAdditionalSystemTables(ITableName[] tables)
at N..ctor(SqlConnection conn, SQLVersion version)
at w.RedGate.SQLCompare.Engine.IDatabaseHelper.GetEncryptedText(r resultSet, Int32 objectID)
at p.a(o A_1, Boolean A_2)
at p.a(o A_1)
at RedGate.SQLCompare.Engine.Database.Register(ConnectionProperties connectionProperties, Options options)
at Tools.SqlCompareReport.SqlCompareReport.RunCompareRport(Int32 RID, String SourceServer, String SourceDB, String DesServer, String DesDB) in C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\DataBaseTools\SqlCompareReport\SqlCompareReport.cs:line 39
at SqlCompareReport.Program.Main(String[] args) in C:\Documents and Settings\Klan\My Documents\Visual Studio 2008\Projects\DataBaseTools\SqlCompareReport\Program.cs:line 25
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Hi Guys ,i am so lost in this error message .Could someone could help me
when call the register function to Register the database, it raise this error all the same.if there hasn't Encrypted objects, it can work well.
DALCompareReport logreport = new DALCompareReport();
string DifferentType = string.Empty;
string FileName = string.Empty;
Options myoptions = Options.Default | Options.DecryptPost2kEncryptedObjects | Options.IgnorePermissions | Options.IgnoreWhiteSpace | Options.IgnoreUsers;
public void RunCompareRport(int RID,string SourceServer, string SourceDB, string DesServer, string DesDB)
{
using (Database stagingDB = new Database(), productionDB = new Database())
{
//ConnectionProperties sourceConnectionProperties = new ConnectionProperties(Program.StagingServerName, Program.StagingDatabaseName);
// ConnectionProperties targetConnectionProperties = new ConnectionProperties(Program.ProductionServerName, Program.ProductionDatabaseName);
ConnectionProperties sourceConnectionProperties = new ConnectionProperties(SourceServer, SourceDB);
ConnectionProperties targetConnectionProperties = new ConnectionProperties(DesServer, DesDB);
// Connect to the two databases and read the schema
try
{
Console.WriteLine("Registering database " + targetConnectionProperties.DatabaseName + " on server " + DesServer);
productionDB.Register(targetConnectionProperties,myoptions); --error happen in this line
Comments
If you have encrypted objects, then you need to ensure the backupreader DLL is included in your solution. In addition, you must compile specifically for "X86" rather than "AnyCPU".
Once you've checked that, if the problem persists, can you let us know:
- does the same thing happen in the SQL Compare GUI?
- what version of the Compare DLL are you using in your solution?
Redgate Software
i have included the backupreader.dll and compiled my project as x86
there hasn't any problem when used the Sql Compare GUI.
i am using the Sql Comparision SDK 8.0
thanks
https://www.red-gate.com/supportcenter/ ... %20Compare
thanks
If the problem persists, you may have an older DLL but I thought v8 should be ok. Check the version number of the actual DLL you are referencing.
Redgate Software
thanks for you reply
i haven't fixed it .
your means that i compile my project with X86? i did it.
the backupreader version is 1.3.0.106
thanks
Redgate Software
but i am a liittle confuse that why this error happened on the sdk 8.1,
it can works when i was using the Compare 8.1 UI .
thanks
Redgate Software