Showing posts with label compact. Show all posts
Showing posts with label compact. Show all posts

Thursday, March 22, 2012

difference between "SQL Mobile 2005" and "SQL Compact 2005"

Hello,

Could someone give me the difference between "Sql Mobile 2005" and "Sql Compact 2005".
At first I thought they were the same, that this was just something of the change in naming the server has had the last months.
My first guess was that Mobile would be the new one, but I have 'accidently' downloaded the Compact and what seems the System.data.SqlServerCE.dll is newer.

So is there a difference?
If yes, what are they.
If not, is the "compact" then the latest version and the name to be used (since on the site only "mobile" is mentioned).

Best regards,
Ike Casteleyn

"SQL Mobile" and "SQL CE" are different names for the same product. There's no "Sql Compact 2005".

There are:

SQL CE 1.0 << Nobody remembers that.

SQL CE 2.0 << Ships with VS 2003. Now obsolete, no desktop support.

SQL Mobile 2005 (AKA SQL CE 3.0) << Ships with VS 2005, limited desktop support.

SQL CE 3.1 << Incremental update from 3.0 - bug fixes and official desktop support.

SQL CE 3.5 << Will be shipped with VS Orcas

|||Hello Ilya,

Thanks for the info. The compact and mobile thing was actually the names of the sdk's that are available.
But I will make sure I'll use the 3.1 version

Thanks,
Ike
|||For detailed information about what's new in version 3.1 see this kb article: http://support.microsoft.com/Default.aspx?kbid=920700|||

The current version of Sql for Mobile Devices is SQL Compact 2005 which version number 3.1 if you want to try the beta is version 3.5. When you install the files say version 3.0 but don't get confuse.

Bye

|||Thanks for the info.

I'll stick to the 3.1 version for now since this one has full support on the desktop without vs2005 installed.
The 3.5 I look at later when it's out of beta.

Best regards,
Ike

Saturday, February 25, 2012

Developing Microsoft SQL Server CE 2.0 Merge Replication Using .NET Compact Framework

We are developing Microsoft SQL Server CE 2.0 Merge Replication Using .NET Compact Framework. There is need of sinhronizations between SQL 2005 Mobile Edition witch resides on Barcode terminal (Windows CE) and SQL 2005 Developer Edition (on Windows XP). Everything is done by the book. There is few lines of code that we are using:
public bool Replicate()
{ bool ret = true;
SqlCeReplication repl = null;
try {
// Instantiate and configure
SqlCeReplication object repl = new SqlCeReplication();
string dbFile = ........
repl.InternetUrl = this.InternetUrl;
repl.InternetLogin = this.InternetLogin;
repl.InternetPassword = this.InternetPassword;
repl.Publisher = this.Publisher;
repl.PublisherDatabase = this.PublisherDatabase;
repl.PublisherLogin = this.PublisherLogin;
repl.PublisherPassword = this.PublisherPassword;
repl.Publication = this.Publication;
repl.Subscriber = this.Subscriber;
repl.SubscriberConnectionString ="Data Source=" +dbFile;
if (!System.IO.File.Exists(dbFile))
{ repl.AddSubscription(AddOption.CreateDatabase);
}
repl.Synchronize();
}
IIS is configured, but in log on the server we've got this error:
2007/08/09 15:33:02 Hr=80004005 ACK:Error for DistributorSessionID = 58 2007/08/09 15:33:02 Hr=80004005 The SQL statement failed to execute. [,,,SQL statement,,] 28560 Please give us posible solution of this problem, we have searched on forums but with no result. p.s. I'ts urgentWe are developing Microsoft SQL Server CE 2.0 Merge Replication Using .NET Compact Framework. There is need of sinhronizations between SQL 2005 Mobile Edition witch resides on Barcode terminal (Windows CE) and SQL 2005 Developer Edition (on Windows XP). Everything is done by the book. There is few lines of code that we are using:
public bool Replicate()
{ bool ret = true;
SqlCeReplication repl = null;
try {
// Instantiate and configure
SqlCeReplication object repl = new SqlCeReplication();
string dbFile = ........
repl.InternetUrl = this.InternetUrl;
repl.InternetLogin = this.InternetLogin;
repl.InternetPassword = this.InternetPassword;
repl.Publisher = this.Publisher;
repl.PublisherDatabase = this.PublisherDatabase;
repl.PublisherLogin = this.PublisherLogin;
repl.PublisherPassword = this.PublisherPassword;
repl.Publication = this.Publication;
repl.Subscriber = this.Subscriber;
repl.SubscriberConnectionString ="Data Source=" +dbFile;
if (!System.IO.File.Exists(dbFile))
{ repl.AddSubscription(AddOption.CreateDatabase);
}
repl.Synchronize();
}
IIS is configured, but in log on the server we've got this error:
2007/08/09 15:33:02 Hr=80004005 ACK:Error for DistributorSessionID = 58 2007/08/09 15:33:02 Hr=80004005 The SQL statement failed to execute. [,,,SQL statement,,] 28560 Please give us posible solution of this problem, we have searched on forums but with no result. p.s. I'ts urgent|||

i hope this will be usefull

Public Shared Function CreateDatabase(ByVal strUserName As String, ByVal strPassword As String) As Boolean
Dim strPublisher, strPublisherDataBase, strPublication As String
Dim strDistributor, strInternetURL As String
Dim strSubscriberDatabasePassword As String
Dim strSubscriberDatabasePath As String
Try
Dim rmReplication As New System.Resources.ResourceManager( _
"RoadRunner.Replication", _
System.Reflection.Assembly.GetExecutingAssembly())
' Assign the resource manager values to data members
strPublication = rmReplication.GetString("Publication")
strPublisher = rmReplication.GetString("Publisher")
strPublisherDataBase = rmReplication.GetString("PublisherDatabase")
strDistributor = rmReplication.GetString("Distributor")
strInternetURL = rmReplication.GetString("InternetUrl")
strSubscriberDatabasePassword = rmReplication.GetString("SubscriberDatabasePassword")
strSubscriberDatabasePath = rmReplication.GetString("SubscriberDatabasePath")

Catch ex As Exception

' MessageBox.Show(ex.Message)
LogFile.AddEntry(ex.Message)
Cursor.Current = Cursors.Default
' if any error occured while reading from resource file, exit function
Return False

End Try
' Declare replication object
Dim replicate As SqlServerCe.SqlCeReplication


Try
' 1: Instantiate replication option
replicate = New SqlServerCe.SqlCeReplication

'***********************************************************
' SQL server 2000 machine name and database for replication
'***********************************************************
replicate.Publisher = strPublisher
replicate.PublisherDatabase = strPublisherDataBase
'**********************************************************
' Publisher server info
'**********************************************************
replicate.Publication = strPublication
replicate.PublisherLogin = strUserName
replicate.PublisherPassword = strPassword
replicate.PublisherSecurityMode = SqlServerCe.SecurityType.NTAuthentication
'**********************************************************
' Distributor server info
'**********************************************************
replicate.Distributor = strDistributor
replicate.DistributorLogin = strUserName
replicate.DistributorPassword = strPassword
replicate.DistributorSecurityMode = SqlServerCe.SecurityType.NTAuthentication
'***********************************************************
' Set subscriber info for salesman and db on PDA
'***********************************************************
replicate.Subscriber = "BTCHH"
replicate.SubscriberConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;" _
& "Data Source=" & strSubscriberDatabasePath _
& ";Password=" & strSubscriberDatabasePassword
'***********************************************************
' IIS server info
'***********************************************************
replicate.InternetUrl = strInternetURL
replicate.InternetLogin = strUserName
replicate.InternetPassword = strPassword
' if database doesn't exist then create it
If System.IO.File.Exists(strSubscriberDatabasePath) = False Then
Try
replicate.AddSubscription(SqlServerCe.AddOption.CreateDatabase)

replicate.Synchronize()
Return True
Catch ex As SqlServerCe.SqlCeException
System.IO.File.Delete(strSubscriberDatabasePath)
ReplicationOperationErrors(ex)
Cursor.Current = Cursors.Default
Return False
End Try
End If

Try
' BuildObject.Compact(strSubscriberDatabasePath)
replicate.ReinitializeSubscription(True)
replicate.Synchronize()
'BuildObject.Dispose()

Catch ex As SqlServerCe.SqlCeException

replicate.Dispose()
MsgBox(ex.Message)
End Try

Return True
Catch ex As SqlServerCe.SqlCeException
ReplicationOperationErrors(ex)
Cursor.Current = Cursors.Default
Return False
Finally
'BuildObject.Dispose()
replicate.Dispose()
End Try
End Function

Developing Microsoft SQL Server CE 2.0 Merge Replication Using .NET Compact Framework

We are developing Microsoft SQL Server CE 2.0 Merge Replication Using .NET Compact Framework. There is need of sinhronizations between SQL 2005 Mobile Edition witch resides on Barcode terminal (Windows CE) and SQL 2005 Developer Edition (on Windows XP). Everything is done by the book. There is few lines of code that we are using:
public bool Replicate()
{ bool ret = true;
SqlCeReplication repl = null;
try {
// Instantiate and configure
SqlCeReplication object repl = new SqlCeReplication();
string dbFile = ........
repl.InternetUrl = this.InternetUrl;
repl.InternetLogin = this.InternetLogin;
repl.InternetPassword = this.InternetPassword;
repl.Publisher = this.Publisher;
repl.PublisherDatabase = this.PublisherDatabase;
repl.PublisherLogin = this.PublisherLogin;
repl.PublisherPassword = this.PublisherPassword;
repl.Publication = this.Publication;
repl.Subscriber = this.Subscriber;
repl.SubscriberConnectionString ="Data Source=" +dbFile;
if (!System.IO.File.Exists(dbFile))
{ repl.AddSubscription(AddOption.CreateDatabase);
}
repl.Synchronize();
}
IIS is configured, but in log on the server we've got this error:
2007/08/09 15:33:02 Hr=80004005 ACK:Error for DistributorSessionID = 58 2007/08/09 15:33:02 Hr=80004005 The SQL statement failed to execute. [,,,SQL statement,,] 28560 Please give us posible solution of this problem, we have searched on forums but with no result. p.s. I'ts urgentWe are developing Microsoft SQL Server CE 2.0 Merge Replication Using .NET Compact Framework. There is need of sinhronizations between SQL 2005 Mobile Edition witch resides on Barcode terminal (Windows CE) and SQL 2005 Developer Edition (on Windows XP). Everything is done by the book. There is few lines of code that we are using:
public bool Replicate()
{ bool ret = true;
SqlCeReplication repl = null;
try {
// Instantiate and configure
SqlCeReplication object repl = new SqlCeReplication();
string dbFile = ........
repl.InternetUrl = this.InternetUrl;
repl.InternetLogin = this.InternetLogin;
repl.InternetPassword = this.InternetPassword;
repl.Publisher = this.Publisher;
repl.PublisherDatabase = this.PublisherDatabase;
repl.PublisherLogin = this.PublisherLogin;
repl.PublisherPassword = this.PublisherPassword;
repl.Publication = this.Publication;
repl.Subscriber = this.Subscriber;
repl.SubscriberConnectionString ="Data Source=" +dbFile;
if (!System.IO.File.Exists(dbFile))
{ repl.AddSubscription(AddOption.CreateDatabase);
}
repl.Synchronize();
}
IIS is configured, but in log on the server we've got this error:
2007/08/09 15:33:02 Hr=80004005 ACK:Error for DistributorSessionID = 58 2007/08/09 15:33:02 Hr=80004005 The SQL statement failed to execute. [,,,SQL statement,,] 28560 Please give us posible solution of this problem, we have searched on forums but with no result. p.s. I'ts urgent|||

i hope this will be usefull

Public Shared Function CreateDatabase(ByVal strUserName As String, ByVal strPassword As String) As Boolean
Dim strPublisher, strPublisherDataBase, strPublication As String
Dim strDistributor, strInternetURL As String
Dim strSubscriberDatabasePassword As String
Dim strSubscriberDatabasePath As String
Try
Dim rmReplication As New System.Resources.ResourceManager( _
"RoadRunner.Replication", _
System.Reflection.Assembly.GetExecutingAssembly())
' Assign the resource manager values to data members
strPublication = rmReplication.GetString("Publication")
strPublisher = rmReplication.GetString("Publisher")
strPublisherDataBase = rmReplication.GetString("PublisherDatabase")
strDistributor = rmReplication.GetString("Distributor")
strInternetURL = rmReplication.GetString("InternetUrl")
strSubscriberDatabasePassword = rmReplication.GetString("SubscriberDatabasePassword")
strSubscriberDatabasePath = rmReplication.GetString("SubscriberDatabasePath")

Catch ex As Exception

' MessageBox.Show(ex.Message)
LogFile.AddEntry(ex.Message)
Cursor.Current = Cursors.Default
' if any error occured while reading from resource file, exit function
Return False

End Try
' Declare replication object
Dim replicate As SqlServerCe.SqlCeReplication


Try
' 1: Instantiate replication option
replicate = New SqlServerCe.SqlCeReplication

'***********************************************************
' SQL server 2000 machine name and database for replication
'***********************************************************
replicate.Publisher = strPublisher
replicate.PublisherDatabase = strPublisherDataBase
'**********************************************************
' Publisher server info
'**********************************************************
replicate.Publication = strPublication
replicate.PublisherLogin = strUserName
replicate.PublisherPassword = strPassword
replicate.PublisherSecurityMode = SqlServerCe.SecurityType.NTAuthentication
'**********************************************************
' Distributor server info
'**********************************************************
replicate.Distributor = strDistributor
replicate.DistributorLogin = strUserName
replicate.DistributorPassword = strPassword
replicate.DistributorSecurityMode = SqlServerCe.SecurityType.NTAuthentication
'***********************************************************
' Set subscriber info for salesman and db on PDA
'***********************************************************
replicate.Subscriber = "BTCHH"
replicate.SubscriberConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;" _
& "Data Source=" & strSubscriberDatabasePath _
& ";Password=" & strSubscriberDatabasePassword
'***********************************************************
' IIS server info
'***********************************************************
replicate.InternetUrl = strInternetURL
replicate.InternetLogin = strUserName
replicate.InternetPassword = strPassword
' if database doesn't exist then create it
If System.IO.File.Exists(strSubscriberDatabasePath) = False Then
Try
replicate.AddSubscription(SqlServerCe.AddOption.CreateDatabase)

replicate.Synchronize()
Return True
Catch ex As SqlServerCe.SqlCeException
System.IO.File.Delete(strSubscriberDatabasePath)
ReplicationOperationErrors(ex)
Cursor.Current = Cursors.Default
Return False
End Try
End If

Try
' BuildObject.Compact(strSubscriberDatabasePath)
replicate.ReinitializeSubscription(True)
replicate.Synchronize()
'BuildObject.Dispose()

Catch ex As SqlServerCe.SqlCeException

replicate.Dispose()
MsgBox(ex.Message)
End Try

Return True
Catch ex As SqlServerCe.SqlCeException
ReplicationOperationErrors(ex)
Cursor.Current = Cursors.Default
Return False
Finally
'BuildObject.Dispose()
replicate.Dispose()
End Try
End Function