Q:

creating document set programmatically in sharepoint server 2010

how to create document set in document library programmatically in sharepoint server 2010?

A:

If you want to use client object model for this:
{
      ClientContext clientContext = new ClientContext("http://<<SERVER_NAME>>");

      Web site = clientContext.Web;

      // Create a list.
      ListCreationInformation listCreationInfo =
        new ListCreationInformation();
      listCreationInfo.Title = "Document Library";
      listCreationInfo.TemplateType = (int)ListTemplateType.DocumentLibrary;
      List list = site.Lists.Add(listCreationInfo);

      // Enable Content Types on list
      list.ContentTypesEnabled = true;

      // Update List Configuration
      list.Update();

      // Send it to SharePoint
      clientContext.ExecuteQuery();

      // Get Content Type Document Set ID = 0x0120D520
      ContentType ctx = clientContext.Site.RootWeb.AvailableContentTypes.GetById("0x0120D520");

      // Add Existing To List
      list.ContentTypes.AddExistingContentType(ctx);

      // Execute
      clientContext.ExecuteQuery();
}

