Software Architecture – Sync Data between offline-Disconnected databases –Sync Framework

October 3, 2010

Problem definition:ERP Product is installed in head office and 5 branch offices such that each location installation has its on database. Locations are connected via Internet that is they are acting as diconnected databases.
We want to sync databases of different branches.
Solution: As discussed in previous post at here
Some possible solutions to problem are as:
• Replication
• ETL
• Sync Providors
• Sync Framework
• Change Data Capture
In this post we will follow Sync Framework to solve this problem.
According to MSDN:

Database synchronization providers are a part of the Microsoft® Sync Framework. Sync Framework is a comprehensive synchronization platform that enables developers to add synchronization capabilities to applications, services, and devices. Sync Framework solves the problem of how to synchronize any type of data in any store using any protocol over any topology. Fundamental to Sync Framework is the ability to support offline and collaboration of data between any types of endpoints (such as device to desktop, device to server, etc.).
Sync Framework database synchronization providers enable synchronization between ADO.NET-enabled databases. Since the database synchronization providers are part of the Sync Framework, any database that uses these providers can then also exchange information with other data sources that are supported by Sync Framework, such as web services, file systems, or custom data stores.
The primary focus of this document will be on synchronizing information between database systems and how Sync Framework helps developers avoid many of the common issues associated with OCAs.

Download Sync Framework 2.1 and install it. Add references to the following DLLs:
o Microsoft.Synchronization.dll
o Microsoft.Synchronization.Data.dll
o Microsoft.Synchronization.Data.SqlServer.dll

Lets consider Employeetable in 2 databases DB1 and DB2, which needs to be synchronized.
L ets declare few global variables as

  static string  SourceSqlConnection = @"Data Source=SOFTCOM-PC\XGURU;Initial Catalog=DB1;Integrated Security=True";
       static string TargetSqlConnection = @"Data Source=SOFTCOM-PC\XGURU;Initial Catalog=DB2;Integrated Security=True";
       static string SourceScopeName = "MySourceScop";
       static string TargetScopeName = "MyTargetScop";
       static string TableToSync = "Employee";

Variable SourceSqlConnection represents the connection string of first database that will take part in sync process. Variable TargetSqlConnection represents the connection string of second database that will take part in sync process. Variable SourceScopeName and TargetScopeName contains name of scope for the two databases. Scope defines what you want to synchronize. Normally tables are added to scope which needs to be sync. Variable TableToSync contain the name of table that will be synced.
Step 1:
Defining Scope and Provisioning for Source SQL Server Database can be done via following method.

 private static void ProvisionSource()
        {
            // create connection to the Source server database
            SqlConnection serverConn = new SqlConnection(SourceSqlConnection);
 
            // define a new scope named MySourceScope
            DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription(SourceScopeName);
 
            // get the description of the GeneralAreaMaster table from SyncDB dtabase
            DbSyncTableDescription tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable(TableToSync, serverConn);
 
            // add the table description to the sync scope definition
            scopeDesc.Tables.Add(tableDesc);
 
            // create a server scope provisioning object based on the ProductScope
            SqlSyncScopeProvisioning serverProvision = new SqlSyncScopeProvisioning(serverConn, scopeDesc);
 
            // skipping the creation of table since table already exists on server
            serverProvision.SetCreateTableDefault(DbSyncCreationOption.Skip);
 
            // start the provisioning process
            try
            {
                serverProvision.Apply();
            }
            catch { }
        }

Step 2:
Defining Scope and Provisioning for Target SQL Server Database can be done via following method.

private static void ProvisionTarget()
        {
            // create connection to the server database
            SqlConnection serverConn = new SqlConnection(TargetSqlConnection);
 
            // define a new scope named MyTargetScope
            DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription(TargetScopeName);
 
            // get the description of the GeneralAreaMaster table from SyncDB dtabase
            DbSyncTableDescription tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable(TableToSync, serverConn);
            // add the table description to the sync scope definition
            scopeDesc.Tables.Add(tableDesc);
 
            // create a server scope provisioning object based on the ProductScope
            SqlSyncScopeProvisioning serverProvision = new SqlSyncScopeProvisioning(serverConn, scopeDesc);
 
            // skipping the creation of table since table already exists on server
            serverProvision.SetCreateTableDefault(DbSyncCreationOption.Skip);
 
            // start the provisioning process
            try
            {
                serverProvision.Apply();
            }
            catch { }
        }

Step 3:
Synchronization between the 2 databases can be done via following code.

private static void SyncSourcewAndTargetDatabases()
        {
            // create a connection to the Source database
            SqlConnection clientConn = new SqlConnection(SourceSqlConnection);
 
            // create a connection to the Target server database
            SqlConnection serverConn = new SqlConnection(TargetSqlConnection);
 
            // create the sync orhcestrator
            SyncOrchestrator syncOrchestrator = new SyncOrchestrator();
 
            // set local provider of orchestrator to a CE sync provider associated with the 
            // ProductsScope in the SyncCompactDB compact client database
            syncOrchestrator.LocalProvider = new SqlSyncProvider(SourceScopeName, clientConn);
 
            // set the remote provider of orchestrator to a server sync provider associated with
            // the ProductsScope in the SyncDB server database
            syncOrchestrator.RemoteProvider = new SqlSyncProvider(TargetScopeName, serverConn);
 
            // set the direction of sync session to Upload and Download
            syncOrchestrator.Direction = SyncDirectionOrder.DownloadAndUpload;
 
            // subscribe for errors that occur when applying changes to the client
            ((SqlSyncProvider)syncOrchestrator.LocalProvider).ApplyChangeFailed += new EventHandler<DbApplyChangeFailedEventArgs>(Program_ApplyChangeFailed);
 
            // execute the synchronization process
            SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();
 
            // print statistics
            Console.WriteLine("Start Time: " + syncStats.SyncStartTime);
            Console.WriteLine("Total Changes Uploaded: " + syncStats.UploadChangesTotal);
            Console.WriteLine("Total Changes Downloaded: " + syncStats.DownloadChangesTotal);
            Console.WriteLine("Complete Time: " + syncStats.SyncEndTime);
            Console.WriteLine(String.Empty);
            Console.ReadLine();
        }
 
        static void Program_ApplyChangeFailed(object sender, DbApplyChangeFailedEventArgs e)
        {
            // display conflict type            Console.WriteLine(e.Conflict.Type);
 
            // display error message 
            Console.WriteLine(e.Error);
        }

This code will sync the data between 2 databases.
For advance cases. See documentation.


Software Architecture – Sync Data between offline/Disconnected databases – SSIS – BIDS

September 18, 2010

Problem definition:
ERP Product is installed in head office and 5 branch offices such that each location installation has its on database. Locations are not connected via Internet that is they are acting as diconnected databases.

We want to sync databases of different branches.

Solution:
Some possible solutions to problem are as:
• Replication
• ETL
• Sync Providors
• Sync Framework
• Change Data Capture
We will compare and analyze pros and corns of these method in separate post. But here we will use ETL approach to solve this problem.
At closing of each working day, data is fetched from each branch database and new data is posted to other branches and head office database Server via email. So each database read email and executes the database differences from other databases.
So we can break whole process in 4 programming Steps.
1. Extract data from source database and convert them into a text file with data/time stamp attached.
[Implemented as SSIS Package and run via C# Code]

For details see post here

2. Read files from a folder in step 1, and send them as attachment in email via Outlook.
[Implemented by interop of MS Outlook API]

For details see post here

3. On other side, emails are pulled automatically via outlook and attachments are downloaded and saved in a local folder in hard disk.
[Implemented by interop of MS Outlook API]
For details see post here

4. Text files s are read from folder and loaded in to database.
[Implemented as SSIS Package and run via C# Code]

For details see post here

Future consideration:

1. How to identify the differential of data between the daily move of data.
2. This solution is working for one table how to handle more tables for data sync process.
3. There are many hardcoded parameters that needs to be fetched from configuration files.

Source: download from here Rename the file to ssis-solution-toupload.zip to extract.
Feedback is welocme


Software Architecture – To Load the data from files of a folder to table of SQL Server via SSIS in SQL Server Business Intelligence Development Studio

September 18, 2010

Objective:
Objective of this post is to load the data from all the files in a folder to a database of SQL Server via SSIS in SQL Server Business Intelligence Development Studio 2008 .

Environment:
SSIS + SQL Server Business Intelligence Development Studio 2008 + C# 4.0

Steps:

1. Create a new Package named “LoadData.dtsx” in BIDS 2008.
2. Create a new variable with name “FileName”.
3. Drag and drop a “Foreach loop container” to SSIS designer.
Set the Enumerator type and configuration settings as shown below.

Set “variable mapping” as shown below.

4. Drag a data flow task on SSIS Designer.
5. On the Data Flow tab, drag and drop the “Flat File Source” from the Data Flow Source in the Data Flow Tool Box. Click on New to create the New Flat File Source Connection Manager. Uses a property expression on the ConnectionString property of a Flat File Connection Manager to point to the file indicated by User::FileName

6. On the Data Flow tab, drag and drop the “OLE DB Designation” from the Data Flow Designation in the Data Flow Tool Box. Create the new OLE DB Designation connection manager by clicking on “New” button on the OLE DB Designation Editor.
Configuration will look like as:

7. So at the end of these changes, Control Flow will look like as:

And Data Flow will look like as:

8. Run the Package from Solution explorer to see the output.
9. Package can be run by following c# code.

string pkgLocation = @"F:\\e-pros\\testbest\\SSISFirst\\SSISFirst\\SSISFirst\\ExtractData.dtsx"; 
 
        Package pkg; 
        Microsoft.SqlServer.Dts.Runtime.Application app; 
        DTSExecResult pkgResults; 
        Variables vars; 
 
        app = new Microsoft.SqlServer.Dts.Runtime.Application(); 
        pkg = app.LoadPackage(pkgLocation, null); 
 
      //  vars = pkg.Variables; 
      //  vars["A_Variable"].Value = "Some value";                
 
        pkgResults = pkg.Execute(null, null, null, null, null);
 
        if (pkgResults == DTSExecResult.Success)
        {
            Console.WriteLine("Package ran successfully");
 
        }
        else
            Console.WriteLine("Package failed"); 

Related Post: https://softarchitect.wordpress.com/2010/09/18/software-architecture-sync-data-between-offlinedisconnected-databases-ssis-bids/


Software Architecture – To extract the data from a table of SQL Server and convert it to text file via SSIS in SQL Server Business Intelligence Development Studio

September 18, 2010

Objective:
Objective of this post is to extract the data from a table of SQL Server and convert it to text file having name as datetime appended via SSIS in SQL Server Business Intelligence Development Studio 2008 .

Environment:
SSIS + SQL Server Business Intelligence Development Studio 2008 + C# 4.0
Steps:

1. Create a new Package named “ExtractData.dtsx” in BIDS 2008.
2. Create a new variable with name “FileLocation” and set its value to folder name, lets say “F:\FileInbox”
3. Append variable “FileLocation” value with datetime stamp by adding a “Script Task” as:
Dts.Variables[“User::FileLocation”].Value = Dts.Variables[“User::FileLocation”].Value.ToString() + “\\data_” + DateTime.Now.ToString(“MMddyyyy_hhmmss”) ;
This command will define the name of data file to be generated.
4. Drag a data flow task on SSIS Designer.
5. On the Data Flow tab, drag and drop the “OLE DB Source” from the Data Flow Sources in the Data Flow Tool Box. Create the new OLE DB source connection manager by clicking on “New” button on the OLE DB Source Editor. Specify the command that will fetch the data from the table as:

SELECT TOP 1000 [AreaId]
,[AreaCode]
,[Description]
,[Active]
,[CreatedDate]
,[ModifiedDate]
,[BranchId]
FROM [GeneralAreaMaster]

6. On the Data Flow tab, drag and drop the “Flat File Destination” from the Data Flow Destinations in the Data Flow Tool Box. Click on New to create the New Flat File Destination Connection Manager. Configure properties accordingly.
7. So at the end of these changes, Control Flow will look like as:

And Data Flow will look like as:

8. Run the Package from Solution explorer to see the output.
9. Package can be run by following c# code.

string pkgLocation = @"F:\\e-pros\\testbest\\SSISFirst\\SSISFirst\\SSISFirst\\ExtractData.dtsx"; 
 
        Package pkg; 
        Microsoft.SqlServer.Dts.Runtime.Application app; 
        DTSExecResult pkgResults; 
        Variables vars; 
 
        app = new Microsoft.SqlServer.Dts.Runtime.Application(); 
        pkg = app.LoadPackage(pkgLocation, null); 
 
      //  vars = pkg.Variables; 
      //  vars["A_Variable"].Value = "Some value";                
 
        pkgResults = pkg.Execute(null, null, null, null, null);
 
        if (pkgResults == DTSExecResult.Success)
        {
            Console.WriteLine("Package ran successfully");
 
        }
        else
            Console.WriteLine("Package failed"); 

Related Post: https://softarchitect.wordpress.com/2010/09/18/software-architecture-sync-data-between-offlinedisconnected-databases-ssis-bids/


Software Architecture – Replication Limitations of SQL Server Express Edition

August 19, 2010

Environment:
SQL Server Express Edition 2008 R2
Problem:
Can SQL Server Express Edition be used in replication?
Solution:
Let’s suppose a typical replication case. Publisher, Distributor and Subscriber are the main elements as shown below.

• SQL Server Express Edition can act a subscriber to a replication process, means that it can receive data in replication.
• SQL Server Express Edition can’t act a publisher/Distributor to a replication process, means that it can’t deliver data in replication.
• So a non Express Edition of SQL Server should be used to act as publisher and in such case Express Edition SQL Server can get data as subscriber.
Reference:
http://msdn.microsoft.com/en-us/library/ms165686.aspx


Software Architecture – Exception -Windows Vista + SQL Server Express edition- Failed to compile the Managed Object Format (MOF) file

August 10, 2010

Environment:
Windows Vista + SQL Server Express edition
Exception:

SQL Server Setup Failed to compile the Managed Object Format (MOF) file ***.mof. To proceed, see “Troubleshooting an Installation of SQL Server 2005” or “How to: View SQL Server 2005 Setup Log Files” in SQL Server 2005 Setup Help documentation.

Actual error will look like as:

Solution:
The problem comes from corruption in the WMI repository, and it can be repaired easily. From a command prompt, running as administrator, run:
winmgmt /salvagerepository
You’ll get an error, but the command has sent a stop request to the WMI service. Run the command a second time, and it will repair the repository and the SQL Server installation can continue.

Reference:
http://msdn.microsoft.com/en-us/library/aa394525(VS.85).aspx


Software Architecture – How to Install Microsoft SQL Server Express Edition with Installer Project and deploy database backup

August 5, 2010

Development Note

Problem definition:
SQL Server Express Edition needs to be installed with Visual studio .Net installer project, so that silent installation of SQL Server Express edition can be performed.

Solution Points:
• Create a new Setup and Deployment project
• Put all the files extracted from SQL Server Express Edition exe in application folder of installer.
• Add Backup file to be restored.
• Check in code project sample,there will be code to check IsDone and IsRestart, left both of this checking as it is, since it is the condition that Installation class left for us to tell the main Startup Form what to do, whether to close the application or to show the form.
• When you first run your application, it checks if the database instance exists, if not it will install the database instance, and restore the backup database to the new database instance.

References:
http://msdn.microsoft.com/en-us/library/bb264562(SQL.90).aspx
http://www.codeproject.com/KB/applications/NET_Installer_With_SQLEXP.aspx
http://www.primordialcode.com/blog/post/install-sql-server-express-with-your-application


Software Architecture – Backup all database of SQL Server via Job/schedule

August 2, 2010

Problem Definition:
In development environment, often it is required to take backup of all databases on weekly basis. During whole week, development is going on by different teams on different databases, so it is very vital to have a backup mechanism for all the database.
So objective is to take backup of all databases in a SQL Server Instance on first day of week during lunch time that is 2:00 pm

Solution:
In SQL Server, Jobs and schedules are used to run any action with specific time plan.
SQL Server agent must be running to run the jobs.

First step is to create a job, by doing a right click on job node in object explorer of SQL Server.





Click on steps to define a action to be performed by putting following T-SQL in command text

DECLARE @name VARCHAR(50) -- database name  
DECLARE @path VARCHAR(256) -- path for backup files  
DECLARE @fileName VARCHAR(256) -- filename for backup  
DECLARE @fileDate VARCHAR(20) -- used for file name 

SET @path = 'F:\DBWeeklyBackup\'  

SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) 

DECLARE db_cursor CURSOR FOR  
SELECT name 
FROM master.dbo.sysdatabases 
WHERE name NOT IN ('master','model','msdb','tempdb')  
	
OPEN db_cursor   
FETCH NEXT FROM db_cursor INTO @name   

WHILE @@FETCH_STATUS = 0   
BEGIN   
       SET @fileName = @path + @name + '_' + @fileDate + '.BAK'  
       BACKUP DATABASE @name TO DISK = @fileName  

       FETCH NEXT FROM db_cursor INTO @name   
END   

CLOSE db_cursor   
DEALLOCATE db_cursor

Step window will look like as:


Click on schedule to define the time plan for job to be run as.

Define the notification for job as:


Test Job by clicking on “Start Job At Step”

It will create backup of all databases in SQL Server at F:\DBWeeklyBackup\ with date appended at the end.


Software Architecture – Design Problem Part 2 – DTO- MS Visual Studio 2010 – Net 4-0 – WCF – NHibernate – Silverlight

July 31, 2010

This is second post with reference to Design Architecture discussion on Project based on NHibernate + WCF+Sliverlight.
See the first Post last post here.

In my last post I had identified that we need DTO Objects.
DTO-Data Transfer Objects are customized object that can have different object structure then Objects used in OR Mapping/Nhibernate. When a request for object comes from client (Silverlight project) to server (ASP .Net project) having Service via WCF wire, at Server side, query is run on OR Mapping Object, utiizing full benefits of Lazy loading, business rules are applied, and finally data is ready to be send to client. At this point data is not in customized according to client needs and filtering of properties for objects is required to reduce the size of data being transferred. That where DTO objects comes in action.

Benefits of DTO objects:

1. It is always better from software design perspective to not expose object of data layer direct to client end that is silverlight via WCF.

2. Most important benefit is: filtering of object properties or Change in structure of objects that needs to be transferred across WCF wire. Let suppose you have invoice creation form having fields to be filled as like client, consignee, agent, shipper, sales person, operation manager and many other. So when loading invoice form data from all these entities like agents ……. will travel on WCF wire. Each entity may have a lot of properties, but on client side we only need id and name of all these entities. So we can make various versions of entities according to need for architecture.

3. With DTO approach, UI (silverlight) is only dependent on DTO objects, so the data layer can be changed to any tech like linq2sql,linq2entities or any other thing. Change in Data layer is very flexible with DTO.

Elements of Design Example:
You can download sample here.
Rename the file as sample.zip and then extract.

Solution Explorer will look like as:



This Example will fetch 2 different DTO objects with sample look and feel as below.


There is one entity class for nhibernate named as “Customer” with HBM set in Mapping.hbm.xml.

There are 2 DTO Classes. First DTO with properties as ClientID,ClientCode, Name.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace WCFNHibernateSilverLightSample.Web.DTOEntities
{
    [DataContract(IsReference = true)] 
    public class DTOCustomer
    {
        #region Fields
        private int _ClientID;
        private string _ClientCode;
        private string _Name;
        #endregion
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the GeneralClientMaster class 
        /// </summary> 
        public DTOCustomer()
        {
        }     
        #endregion

        #region Properties
        /// <summary>
        /// Gets or sets the ClientID for the current GeneralClientMaster
        /// </summary>
        [DataMember]
        public virtual int ClientID
        {
            get { return _ClientID; }
            set { _ClientID = value; }
        }

        /// <summary>
        /// Gets or sets the ClientCode for the current GeneralClientMaster
        /// </summary>
        [DataMember]
        public virtual string ClientCode
        {
            get { return _ClientCode; }
            set { _ClientCode = value; }
        }
        [DataMember]
        public virtual string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        #endregion

    }

    
}

Second DTO class has extra parameter of Address as:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace WCFNHibernateSilverLightSample.Web.DTOEntities
{
    [DataContract(IsReference = true)]
    public class DTOCustomerVersionWithAddress
    {
        #region Fields
        private int _ClientID;
        private string _ClientCode;
        private string _Name;
        private string _Address;
        #endregion
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the GeneralClientMaster class 
        /// </summary> 
        public DTOCustomerVersionWithAddress()
        {
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets or sets the ClientID for the current GeneralClientMaster
        /// </summary>
        [DataMember]
        public virtual int ClientID
        {
            get { return _ClientID; }
            set { _ClientID = value; }
        }

        /// <summary>
        /// Gets or sets the ClientCode for the current GeneralClientMaster
        /// </summary>
        [DataMember]
        public virtual string ClientCode
        {
            get { return _ClientCode; }
            set { _ClientCode = value; }
        }
        [DataMember]
        public virtual string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        [DataMember]
        public virtual string Address
        {
            get { return _Address; }
            set { _Address = value; }
        }

        #endregion

    }
 
}

A converter class will be required as below to transform “customer” to “DTOCustomer” and “DTOCustomerVersionWithAddress”.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WCFNHibernateSilverLightSample.Web.DTOEntities.DTOConvertor
{
    public class DTOConvertor
    {
        #region CustomerConvertor

        public static DTOCustomer ConvertFromCustomerToDTOCustomer(Customer cust)
        {
            DTOCustomer dtocus = new DTOCustomer();
            dtocus.ClientID =  cust.ClientID;
            dtocus.ClientCode =  cust.ClientCode;
            dtocus.Name =  cust.Name;            
            return dtocus;            
        }
        public static DTOCustomerVersionWithAddress ConvertFromCustomerToDTOCustomerVersionWithAddress(Customer cust)
        {
            DTOCustomerVersionWithAddress dtocus = new DTOCustomerVersionWithAddress();
            dtocus.ClientID = cust.ClientID;
            dtocus.ClientCode = cust.ClientCode;
            dtocus.Name = cust.Name;
            // Note here Transformation of properties from Nhibernate Object to DTO Objects
            // It is really a simple example. Very advance level tranformation can be done.
            dtocus.Address = cust.PostalAddress + " Tel: " + cust.Phone1 + " Fax: " + cust.Fax1 + " Email : " + cust.Email;
            return dtocus;
        }
        #endregion CustomerConvertor
    }
}

The WCF Service code will look like as

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Channels;
using NHibernate;
using WCFNHibernateSilverLightSample.Web.DTOEntities;
using WCFNHibernateSilverLightSample.Web.DTOEntities.DTOConvertor;

namespace WCFNHibernateSilverLightSample.Web
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "GetDataService" in code, svc and config file together.
    public class GetDataService : IGetDataService
    {
        public IList<DTOCustomer> GetCustomer()
        {
            IList<Customer> list;
            IList<DTOCustomer> listDTO =  new List<DTOCustomer>();
            NHibernate.ISession session = NHibernateHelper.OpenSession();
            ICriteria query = session.CreateCriteria(typeof(Customer));
            list = query.List<Customer>();

            foreach(Customer c in list)
            {
                listDTO.Add(DTOConvertor.ConvertFromCustomerToDTOCustomer(c));
            }
            return listDTO;
        }
        public IList<DTOCustomerVersionWithAddress> GetCustomerWithAddress()
        {
            IList<Customer> list;
            IList<DTOCustomerVersionWithAddress> listDTO = new List<DTOCustomerVersionWithAddress>();
            NHibernate.ISession session = NHibernateHelper.OpenSession();
            ICriteria query = session.CreateCriteria(typeof(Customer));
            list = query.List<Customer>();

            foreach (Customer c in list)
            {
                listDTO.Add(DTOConvertor.ConvertFromCustomerToDTOCustomerVersionWithAddress(c));
            }
            return listDTO;
        }
    }
}

You can download sample here.
Rename the file as sample.zip and then extract.


Software Architecture – Microsoft SQL Server Express Edition with Advance Features -Licensing Query

July 29, 2010

While Exploring Licensing option for PCMS ERP Pegasus Cargo Management System, i had passed a query to Microsoft-Pakistan.

My Query to Microsoft Licensing Team – Islamabad – Pakistan

We are evaluating to use Microsoft SQL Server Express edition with advance features for our product.

With reference to your link below,
http://msdn.microsoft.com/en-us/library/cc645993.aspx
We have some questions as:

1. Is there any limitation of number of clients connecting to SQL Server express edition with advance features?

2. Secondly, table with title as “Scalability and Performance” in the above link suggests that there is a limitation of “Maximum memory utilized” as “1 GB” for SQL Server Express edition with advance features.. What is the meaning of this limitation, can you please explain it in more detail? Does this memory refer to the size of memory that can be used in system where SQL server will be installed or it is the memory being used by SQL server process in task manager of OS.


Is there any limitation of number of clients connecting to SQL Server express edition with advance features?

Microsoft Answer:- Yes, generally SQL Server allows 32,767 concurrent / simultaneous connections, however for your instance you can check by running the @@MAX_CONNECTIONS function. This function would return you the maximum number of connections on that particular instance, however it can be different from the currently configured maximum number of connections on that particular instance so this is configurable (sp_configure) but staying within the maximum connection limit.

Secondly, table with title as “Scalability and Performance” in the above link suggests that there is a limitation of “Maximum memory utilized” as “1 GB” for SQL Server Express edition with advance features.. What is the meaning of this limitation, can you please explain it in more detail? Does this memory refer to the size of memory that can be used in system where SQL server will be installed or it is the memory being used by SQL server process in task manager of OS.

Microsoft Answer:- This is the maximum memory which SQL Server express can use, regardless of the system memory.