I am a C# newbie, I was trying to create a desktop application for merge replication between server and client using sql server. But I don't know how to go about it.
Thanks for asking question, but there are very few details about the task on which you are working, I suppose from "Replication" you mean "Replication Management Objects (RMO)"
RMO allows programmatic control of Replication via the Microsoft.SqlServer.Replication namespace.
Have a look at Replication Management Object Concepts to get started.
Keep in mind that RMO is deprecated and may be removed in a future release of SQL Server.
Also, please see How to: Synchronize a Push Subscription (RMO Programming) and How to: Synchronize a Pull Subscription (RMO Programming) for instructions on how to synchronize a Merge subscription programmatically using Replication Management Objects in C#.
You can also take a look at http://www.nullskull.com/a/10474998/sql-server-replication-using-c.aspx
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly