Friday, February 24, 2012
C# Replication Between Microsoft SQL server 2000 and Microsoft Access
Currently I need to perform in C# merge publication between SQL Server
2000 and Microsoft Access 2000. I tried using Jet Object Replication
COM to perform this but encounter the following error.
Any advice or alternative solution is greatly appreciated.
Thanks.
Rgds,
Winston
Codes
JRO.ReplicaClass rep1 = new JRO.ReplicaClass();
rep1.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\\Test\\SyncTest\\SyncTest\\synctest.mdb" ;
rep1.Synchronize("TestSrv.TestDB.TestPub",
JRO.SyncTypeEnum.jrSyncTypeImpExp,
JRO.SyncModeEnum.jrSyncModeDirect);
Errors
System.Runtime.InteropServices.COMException (0x800A0BB9): Arguments
are of the wrong type, are out of acceptable range, or are in conflict
with one another.
at JRO.ReplicaClass.set_ActiveConnection(Object ppconn)
The above error occurs at line:
rep1.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\\Test\\SyncTest\\SyncTest\\synctest.mdb" ;
can you post your entire code?
"Winston" <skuzski@.hotmail.com> wrote in message
news:62956cb.0403311901.75d424a1@.posting.google.co m...
> Hi all,
> Currently I need to perform in C# merge publication between SQL Server
> 2000 and Microsoft Access 2000. I tried using Jet Object Replication
> COM to perform this but encounter the following error.
> Any advice or alternative solution is greatly appreciated.
> Thanks.
> Rgds,
> Winston
> Codes
> --
> JRO.ReplicaClass rep1 = new JRO.ReplicaClass();
> rep1.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=C:\\Test\\SyncTest\\SyncTest\\synctest.mdb" ;
> rep1.Synchronize("TestSrv.TestDB.TestPub",
> JRO.SyncTypeEnum.jrSyncTypeImpExp,
> JRO.SyncModeEnum.jrSyncModeDirect);
> Errors
> --
> System.Runtime.InteropServices.COMException (0x800A0BB9): Arguments
> are of the wrong type, are out of acceptable range, or are in conflict
> with one another.
> at JRO.ReplicaClass.set_ActiveConnection(Object ppconn)
> The above error occurs at line:
> rep1.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=C:\\Test\\SyncTest\\SyncTest\\synctest.mdb" ;
|||"Hilary Cotter" <hilaryk@.att.net> wrote in message news:<e79fC15FEHA.2732@.tk2msftngp13.phx.gbl>...
> can you post your entire code?
Hi,
The entire code is:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
namespace SyncTest
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after
// InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(176, 120);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(232, 40);
this.button1.TabIndex = 0;
this.button1.Text = "Sync";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 273);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
JRO.ReplicaClass rep1 = new JRO.ReplicaClass();
rep1.ActiveConnection
= "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\\CupaDMS\\SyncTest\\SyncTest\\synctest.m db";
rep1.Synchronize("buildfoliousa\buildfoliousa.insp ections.inspections",
JRO.SyncTypeEnum.jrSyncTypeImpExp, JRO.SyncModeEnum.jrSyncModeDirect);
}
}
}
C# Replication
used by marketers to keep track of their leads and appointments. Currently
two marketers are using this application on laptops. Obvisouly the two
marketers will have different data on their laptops. They need to share the
same data and the only way to do this is through merging the databases.
I thought about merging the database on the laptop with a database on our
local server, and then the server and laptop will be updated with the latest
information.
I need to do this through c# and I'm having trouble setting up sql to make
use of merging.
Please help me on ideas or how to go about this.
ThanxI take it you are talking about merge replication. Use the Replication
Wizard to create a merge publication. You can then use the merge replication
ActiveX control to pull this
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Xml;
using System.Net;
using System.Data.SqlClient;
using System.Runtime.InteropServices;
using SQLINITXLib;
using SQLMERGXLib;
namespace MergeDemo1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.DataGrid dataGrid1;
public System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.DataGrid dataGrid2;
private SqlDataAdapter SQLDataAdapterPub;
private SqlDataAdapter SQLDataAdapterSub;
private DataSet DataSetPub=new DataSet();
private DataSet DataSetSub=new DataSet();
public event _SQLMergeEvents_StatusEventHandler StatusEventMerge;
public event _SQLSnapshotEvents_StatusEventHandler StatusEventSnapshot;
private System.Windows.Forms.Button UpdatePublisher;
private System.Windows.Forms.Button UpdateSubscriber;
private System.Windows.Forms.Button CloseButton;
private System.Windows.Forms.Label SubscriberConflicts;
private System.Windows.Forms.Label SubscriberChanges;
private System.Windows.Forms.Label PublisherChanges;
private System.Windows.Forms.Label PublisherConflicts;
private System.Windows.Forms.Button Sync;
private System.Windows.Forms.ProgressBar progressBar1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.UpdatePublisher = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.CloseButton = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.dataGrid2 = new System.Windows.Forms.DataGrid();
this.UpdateSubscriber = new System.Windows.Forms.Button();
this.Sync = new System.Windows.Forms.Button();
this.SubscriberConflicts = new System.Windows.Forms.Label();
this.SubscriberChanges = new System.Windows.Forms.Label();
this.PublisherChanges = new System.Windows.Forms.Label();
this.PublisherConflicts = new System.Windows.Forms.Label();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).BeginInit();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(24, 16);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(144, 48);
this.button1.TabIndex = 0;
this.button1.Text = "Click to generate and distribute Snapshot";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(48, 168);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(832, 272);
this.dataGrid1.TabIndex = 2;
//
// UpdatePublisher
//
this.UpdatePublisher.Location = new System.Drawing.Point(208, 16);
this.UpdatePublisher.Name = "UpdatePublisher";
this.UpdatePublisher.Size = new System.Drawing.Size(152, 48);
this.UpdatePublisher.TabIndex = 3;
this.UpdatePublisher.Text = "Click to Update Publisher";
this.UpdatePublisher.Visible = false;
this.UpdatePublisher.Click += new
System.EventHandler(this.UpdatePublisher_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(112, 128);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(760, 32);
this.label1.TabIndex = 4;
this.label1.Text = "label1";
this.label1.Visible = false;
//
// CloseButton
//
this.CloseButton.Location = new System.Drawing.Point(592, 16);
this.CloseButton.Name = "CloseButton";
this.CloseButton.Size = new System.Drawing.Size(152, 48);
this.CloseButton.TabIndex = 5;
this.CloseButton.Text = "Close";
this.CloseButton.Click += new System.EventHandler(this.Close_Click);
//
// label2
//
this.label2.Location = new System.Drawing.Point(48, 128);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 32);
this.label2.TabIndex = 6;
this.label2.Text = "Publisher";
//
// label3
//
this.label3.Location = new System.Drawing.Point(48, 472);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 32);
this.label3.TabIndex = 8;
this.label3.Text = "Subscriber";
//
// dataGrid2
//
this.dataGrid2.DataMember = "";
this.dataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid2.Location = new System.Drawing.Point(48, 512);
this.dataGrid2.Name = "dataGrid2";
this.dataGrid2.Size = new System.Drawing.Size(832, 272);
this.dataGrid2.TabIndex = 7;
//
// UpdateSubscriber
//
this.UpdateSubscriber.Location = new System.Drawing.Point(208, 456);
this.UpdateSubscriber.Name = "UpdateSubscriber";
this.UpdateSubscriber.Size = new System.Drawing.Size(152, 48);
this.UpdateSubscriber.TabIndex = 9;
this.UpdateSubscriber.Text = "Click to Update Subscriber";
this.UpdateSubscriber.Visible = false;
this.UpdateSubscriber.Click += new
System.EventHandler(this.UpdateSubscriber_Click);
//
// Sync
//
this.Sync.Location = new System.Drawing.Point(400, 16);
this.Sync.Name = "Sync";
this.Sync.Size = new System.Drawing.Size(152, 48);
this.Sync.TabIndex = 10;
this.Sync.Text = "Synchronize";
this.Sync.Visible = false;
this.Sync.Click += new System.EventHandler(this.Sync_Click);
//
// SubscriberConflicts
//
this.SubscriberConflicts.Location = new System.Drawing.Point(376, 456);
this.SubscriberConflicts.Name = "SubscriberConflicts";
this.SubscriberConflicts.Size = new System.Drawing.Size(144, 24);
this.SubscriberConflicts.TabIndex = 11;
this.SubscriberConflicts.Text = "Subscriber Conflicts: 0";
//
// SubscriberChanges
//
this.SubscriberChanges.Location = new System.Drawing.Point(512, 456);
this.SubscriberChanges.Name = "SubscriberChanges";
this.SubscriberChanges.Size = new System.Drawing.Size(144, 24);
this.SubscriberChanges.TabIndex = 12;
this.SubscriberChanges.Text = "Subscriber Changes: 0";
//
// PublisherChanges
//
this.PublisherChanges.Location = new System.Drawing.Point(512, 80);
this.PublisherChanges.Name = "PublisherChanges";
this.PublisherChanges.Size = new System.Drawing.Size(144, 24);
this.PublisherChanges.TabIndex = 14;
this.PublisherChanges.Text = "Publisher Changes: 0";
//
// PublisherConflicts
//
this.PublisherConflicts.Location = new System.Drawing.Point(376, 80);
this.PublisherConflicts.Name = "PublisherConflicts";
this.PublisherConflicts.Size = new System.Drawing.Size(144, 24);
this.PublisherConflicts.TabIndex = 13;
this.PublisherConflicts.Text = "Publisher Conflicts: 0";
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(112, 152);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(168, 8);
this.progressBar1.TabIndex = 15;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(896, 853);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.PublisherChanges);
this.Controls.Add(this.PublisherConflicts);
this.Controls.Add(this.SubscriberChanges);
this.Controls.Add(this.SubscriberConflicts);
this.Controls.Add(this.Sync);
this.Controls.Add(this.UpdateSubscriber);
this.Controls.Add(this.label3);
this.Controls.Add(this.dataGrid2);
this.Controls.Add(this.label2);
this.Controls.Add(this.CloseButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.UpdatePublisher);
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Merge Demo";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{}
private void Synchronize()
{
//run snapshot
//synchronize mergesub
Snapshot();
Synchronzie_mergesub();
}
private void Snapshot()
{
SQLSnapshot objSnapshot= new SQLSnapshotClass();
objSnapshot.Publisher = System.Environment.MachineName.ToString();
objSnapshot.PublisherSecurityMode =
SQLINITXLib.SECURITY_TYPE.NT_AUTHENTICATION;
objSnapshot.PublisherDatabase = "Northwind";
objSnapshot.Publication = "Northwind";
objSnapshot.ReplicationType=SQLINITXLib.REPLICATION_TYPE.MERGE;
objSnapshot.Distributor = System.Environment.MachineName.ToString();
objSnapshot.DistributorSecurityMode =
SQLINITXLib.SECURITY_TYPE.NT_AUTHENTICATION;
objSnapshot.Status +=new
_SQLSnapshotEvents_StatusEventHandler(ob
jSnapshot_Status);
try
{
button1.Visible=false;
label1.Visible=true;
label1.Text = "Generating snapshot...";
label1.Refresh();
objSnapshot.Initialize();
objSnapshot.Run();
objSnapshot.Terminate();
label1.Text = "Snapshot generated...";
label1.Refresh();
}
catch (Exception e)
{
MessageBox.Show(e.StackTrace);
MessageBox.Show(e.Message);
}
}
private void Synchronzie_mergesub()
{
SQLMergeClass objMerge = new SQLMergeClass();
objMerge.Publisher=System.Environment.MachineName.ToString();
objMerge.Publisher=Dns.GetHostName();
objMerge.PublisherDatabase="Northwind";
objMerge.Publication="Northwind";
objMerge.PublisherSecurityMode=SQLMERGXLib.SECURITY_TYPE.NT_AUTHENTICATION;
objMerge.Subscriber=System.Environment.MachineName.ToString();
objMerge.SubscriberDatabase="mergesub";
objMerge.SubscriberSecurityMode=SQLMERGXLib.SECURITY_TYPE.NT_AUTHENTICATION;
objMerge.Status +=new
_SQLMergeEvents_StatusEventHandler(objMe
rge_Status);
try
{
label1.Visible=true;
label1.Text="Initializing Merge Sub";
label1.Refresh();
objMerge.Initialize();
objMerge.Run();
label1.Text="Running Merge Agent";
label1.Refresh();
objMerge.Terminate();
label1.Text="Merge Agent complete";
label1.Refresh();
}
catch(Exception e)
{
MessageBox.Show(e.StackTrace);
MessageBox.Show(e.Message);
}
PublisherConflicts.Text="Publisher Conflicts: " +
objMerge.PublisherConflicts.ToString();
PublisherConflicts.Update();
PublisherChanges.Text="Publisher Changes: " +
objMerge.PublisherChanges.ToString();
PublisherChanges.Update();
SubscriberConflicts.Text="Subscriber Conflicts: " +
objMerge.SubscriberConflicts.ToString();
SubscriberConflicts.Update();
SubscriberChanges.Text="Subscriber Changes: " +
objMerge.SubscriberChanges.ToString();
SubscriberChanges.Update();
}
public void button1_Click(object sender, System.EventArgs e)
{
Synchronize();
PopulateDataGrids();
}
public void PopulateDataGrids()
{
SqlConnection objConnectionPub = null;
SqlConnection objConnectionSub = null;
try
{
objConnectionPub = new
SqlConnection("Data Source=(local);Integrated Security=SSPI;Initial
Catalog=Northwind");
objConnectionSub = new
SqlConnection("Data Source=(local);Integrated Security=SSPI;Initial
Catalog=mergesub");
//SQLDataAdapaterPub(
this.SQLDataAdapterPub= new SqlDataAdapter("Select * from
Customers",objConnectionPub);
this.SQLDataAdapterSub= new SqlDataAdapter("Select * from
Customers",objConnectionSub);
DataSetPub.Clear();
DataSetSub.Clear();
SQLDataAdapterPub.Fill(DataSetPub, "Customers");
SQLDataAdapterSub.Fill(DataSetSub, "Customers");
dataGrid1.DataSource = DataSetPub.DefaultViewManager;
dataGrid1.DataMember="Customers";
dataGrid2.DataSource = DataSetSub.DefaultViewManager;
dataGrid2.DataMember="Customers";
UpdatePublisher.Visible=true;
UpdateSubscriber.Visible=true;
SqlCommandBuilder commandBuilderPub = new
SqlCommandBuilder(SQLDataAdapterPub);
SqlCommandBuilder commandBuilderSub = new
SqlCommandBuilder(SQLDataAdapterSub);
}
catch (Exception oE)
{
MessageBox.Show("Problem Populating DataGrid: [" + oE.ToString() + "]");
}
finally
{
if (objConnectionPub!= null )
{
if (objConnectionPub.State == ConnectionState.Open)
objConnectionPub.Close();
}
if (objConnectionSub!= null )
{
if (objConnectionSub.State == ConnectionState.Open)
objConnectionSub.Close();
}
}
}
private void Close_Click(object sender, System.EventArgs e)
{
this.Close();
}
public void UpdatePublisher_Click(object sender, System.EventArgs e)
{
UpdateSubscriber.Visible=true;
if(DataSetPub!= null && DataSetPub.HasChanges())
{
SQLDataAdapterPub.Update(DataSetPub, "Customers");
}
Sync.Visible=true;
}
public SQLINITXLib.STATUS_RETURN_CODE objSnapshot_Status(string Message,
int Percent)
{
label1.Text=Message.ToString() +" " +Percent.ToString() + "% complete.";
label1.Update();
progressBar1.Value=Percent;
progressBar1.Update();
StatusEventSnapshot(Message, Percent);
return new SQLINITXLib.STATUS_RETURN_CODE ();
}
public SQLMERGXLib.STATUS_RETURN_CODE objMerge_Status(string Message, int
Percent)
{
label1.Text=Message.ToString() +" " +Percent.ToString() + "% complete.";
label1.Update();
progressBar1.Value=Percent;
progressBar1.Update();
StatusEventMerge(Message, Percent);
return new SQLMERGXLib.STATUS_RETURN_CODE ();
}
private void UpdateSubscriber_Click(object sender, System.EventArgs e)
{
UpdateSubscriber.Visible=true;
if(DataSetSub!= null && DataSetSub.HasChanges())
{
SQLDataAdapterSub.Update(DataSetSub, "Customers");
}
Sync.Visible=true;
}
private void Sync_Click(object sender, System.EventArgs e)
{
Synchronzie_mergesub();
PopulateDataGrids();
dataGrid1.Update();
}
}
}
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Developer" <Developer@.discussions.microsoft.com> wrote in message
news:3E371B74-9DC6-458D-9169-419D741CD547@.microsoft.com...
> I have a c# application that runs off a local database. This application
is
> used by marketers to keep track of their leads and appointments. Currently
> two marketers are using this application on laptops. Obvisouly the two
> marketers will have different data on their laptops. They need to share
the
> same data and the only way to do this is through merging the databases.
> I thought about merging the database on the laptop with a database on our
> local server, and then the server and laptop will be updated with the
latest
> information.
> I need to do this through c# and I'm having trouble setting up sql to make
> use of merging.
> Please help me on ideas or how to go about this.
> Thanx|||The following article describes how to use offline MSDE installations as
merge replication subscribers to an online SQL Server acting as a publisher.
http://support.microsoft.com/defaul...kb;en-us;324992
"Developer" <Developer@.discussions.microsoft.com> wrote in message
news:3E371B74-9DC6-458D-9169-419D741CD547@.microsoft.com...
>I have a c# application that runs off a local database. This application is
> used by marketers to keep track of their leads and appointments. Currently
> two marketers are using this application on laptops. Obvisouly the two
> marketers will have different data on their laptops. They need to share
> the
> same data and the only way to do this is through merging the databases.
> I thought about merging the database on the laptop with a database on our
> local server, and then the server and laptop will be updated with the
> latest
> information.
> I need to do this through c# and I'm having trouble setting up sql to make
> use of merging.
> Please help me on ideas or how to go about this.
> Thanx
Thursday, February 16, 2012
byte by byte level replication versus sql server replication
Can anyone give me a helpful link or information on the pros and cons on the
"byte by byte level replication" versus "sql server transaction replication".
Requirement:
I need upto second replication to a geographically remote site, so I was
considering sql server transactional replication versus byte by byte data
level replication between the geographically remote servers.
What are the pros and cons?
Any kind of information would be of help.
Thanks
For software solutions - Byte by byte is not good for write intensive
operations - I find it doesn't scale well.
For hardware solutions look at products like EMC's SRDF. Its very expensive.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:D3925A66-6ED5-4795-AE50-B5BA56F6D7B4@.microsoft.com...
> Hi
> Can anyone give me a helpful link or information on the pros and cons on
the
> "byte by byte level replication" versus "sql server transaction
replication".
> Requirement:
> I need upto second replication to a geographically remote site, so I was
> considering sql server transactional replication versus byte by byte data
> level replication between the geographically remote servers.
> What are the pros and cons?
> Any kind of information would be of help.
> Thanks
>
>
|||Hi
When you say software solutions, what does it mean? It has to have a
software on a hardware box even EMC SRDF is a remote replication software
solution.
Is the Data Replication Manager (DRM) from HP on XP hardware comparable to
EMC's SRDF?
can you please clarify the hardware and software solutions difference.
Thanks
"Hilary Cotter" wrote:
> For software solutions - Byte by byte is not good for write intensive
> operations - I find it doesn't scale well.
> For hardware solutions look at products like EMC's SRDF. Its very expensive.
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "Pari" <Pari@.discussions.microsoft.com> wrote in message
> news:D3925A66-6ED5-4795-AE50-B5BA56F6D7B4@.microsoft.com...
> the
> replication".
>
>
|||A software solution which does a byte by byte copy is DoubleTake. I believe
it has a driver which sits between your os and the disk array and monitors
byte activity, then it copies deltas to the destination server.
Data Replication Manager sounds similar to EMC's SRDF, but I am not sure if
either can run on XP.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:46724538-E7A1-46FC-A6BF-A786DF7B4508@.microsoft.com...[vbcol=seagreen]
> Hi
> When you say software solutions, what does it mean? It has to have a
> software on a hardware box even EMC SRDF is a remote replication software
> solution.
> Is the Data Replication Manager (DRM) from HP on XP hardware comparable to
> EMC's SRDF?
> can you please clarify the hardware and software solutions difference.
> Thanks
> "Hilary Cotter" wrote:
expensive.[vbcol=seagreen]
on[vbcol=seagreen]
was[vbcol=seagreen]
data[vbcol=seagreen]
bypass mode
applying changes, my db went to suspect mode,
by running following script
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768 where name = 'criticaldevices'
go
Sp_configure "allow updates", 0
go
Reconfigure with override
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 0 where name = 'criticaldevices'
go
Sp_configure "allow updates", 0
go
Reconfigure with override
while starting snopshot agent, i got following error
Could not run BEGIN TRANSACTION in database 'CriticalDevices' because the
database is in bypass recovery mode.
Can anyone help me to solve this issue
thanks
Kalyan
did you follow all of the steps listed here?
http://groups.google.com/group/micro...e=source&hl=en
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Kalyan" <Kalyan@.discussions.microsoft.com> wrote in message
news:FD9CB3DF-315A-4AA7-81B5-88503B9181FF@.microsoft.com...
> i have setup replication that works fine, after adding some article while
> applying changes, my db went to suspect mode,
> by running following script
> Sp_configure "allow updates", 1
> go
> Reconfigure with override
> GO
> Update sysdatabases set status = 32768 where name = 'criticaldevices'
> go
> Sp_configure "allow updates", 0
> go
> Reconfigure with override
> Sp_configure "allow updates", 1
> go
> Reconfigure with override
> GO
> Update sysdatabases set status = 0 where name = 'criticaldevices'
> go
> Sp_configure "allow updates", 0
> go
> Reconfigure with override
>
> while starting snopshot agent, i got following error
> Could not run BEGIN TRANSACTION in database 'CriticalDevices' because the
> database is in bypass recovery mode.
> Can anyone help me to solve this issue
> thanks
> Kalyan
Tuesday, February 14, 2012
Business Logic Handler Not Loading
Microsoft.SqlServer.Replication.BusinessLogicSupport.BusinessLogicModule. The replication is between a SQL Server 2005 Express subscriber and a SQL Server 2005 publisher/distributer.
The problem is that the resolver class in the DLL will not load; although, it does appear to find the DLL. (If I rename the DLL I get a "file not found error"). The exact error message is:
Microsoft.SqlServer.Replication.ComErrorException
"Error loading custom class "MergeConflictHandler" from custom assembly "MergeConflictHandler",
Error : "Could not load type 'MergeConflictHandler' from assembly 'MergeConflictHandler, Version=1.0.2502.22393, Culture=neutral, PublicKeyToken=0403e50cc4dc27fa'."."}
I placed the DLL in the directory of the program that calls SynchronizationAgent.Synchronize and tried it with and without being registered in the GAC. There was no change. Interestingly, when I move the file out of that location, but register it in the GAC, the file is not found. Thinking it may be a security problem, I gave Everyone Read & Execute and Read privileges. I believe the class is actually instantiated by replmerge.exe, an apparantly unmanaged app, so I tried marking it ComVisible. No Luck.
I registered the resolver with the following T-SQL code:
sp_registercustomresolver @.article_resolver = 'eClinical Notes Conflict Resolver'
, @.is_dotnet_assembly = 'true'
, @.dotnet_assembly_name = 'MergeConflictHandler'
, @.dotnet_class_name = 'MergeConflictHandler'
, @.resolver_clsid = Null
The resolver I've created is not much more than a shell at this point. It is pasted below, but I tried using the code found on MSDN character-for-character and had the same problem.
using System;
using System.Text;
using System.Data;
using System.Data.Common;
using Microsoft.SqlServer.Replication.BusinessLogicSupport;
namespace MergeConflictHandler
{
public class MergeConflictHandler :
Microsoft.SqlServer.Replication.BusinessLogicSupport.BusinessLogicModule
{
// Variables to hold server names.
private string m_PublisherName;
private string m_SubscriberName;
private string m_Artical_Name;
public MergeConflictHandler()
{
}
// Implement the Initialize method to get publication
// and subscription information.
public override void Initialize(string publisher, string subscriber, string distributor, string publisherDB, string subscriberDB,string articleName)
{
m_PublisherName = publisher;
m_SubscriberName = subscriber;
m_Artical_Name = articleName;
}
// Declare what types of row changes, conflicts, or errors to handle.
public override ChangeStates HandledChangeStates
{
get
{
return ChangeStates.UpdateConflicts;
}
}
public override ActionOnUpdateConflict UpdateConflictsHandler(DataSet publisherDataSet, DataSet subscriberDataSet, ref DataSet customDataSet, ref ConflictLogType conflictLogType, ref string customConflictMessage, ref int historyLogLevel, ref string historyLogMessage)
{
if (m_Artical_Name == "PatientAllergies")
{
// Accept the updated data in the Subscriber's data set and apply it to the Publisher.
}
return ActionOnUpdateConflict.AcceptPublisherData;
}
}
}
Does anyone have any thoughts or advice? (Help!)
I had similar problems
I found that the parameter @.dotnet_class_name had to be set to assemblyName.className
If in your case the assembly is named the same as the class then it would need to be set to MergeConflictHandler.MergeConflictHandler
|||
Aero1 Thanks So Much
It is now working, although not exactly as you said. Apparantly the @.dot_class_name parameter needs to be prefixed with the Namespace, not the assemblyName. Perhaps your name space and assemblyName were the same for you? Anyway, I had tried prefixing the Namespace before, but obviously I did something wrong then. As an added benefit, it makes sense. Of course it still should be better documented! So to highlight the answer for future readers:
@.dot_class_name = 'Namespace.Classname'
Thanks again... Life is once again worth living.
This is documented in: http://msdn2.microsoft.com/zh-cn/library/ms147911.aspx
However we will try to make it more discoverable.