The gp results shouldn't be coming back as null. I took a few minutes to write up the attached sample. Because you're using the gp tools I also used the gp tools instead of executing this entire workflow in ArcObjects. I've also pasted the code to create the join below. There is also a second sample in the attachment that shows how to commit the join by calling the copy features tool.
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.DataManagementTools;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geoprocessing;
using ESRI.ArcGIS.Geoprocessor;
using System;
using System.IO;
namespace ArcMapAddin
{
public class AddJoinLayerToMap : ESRI.ArcGIS.Desktop.AddIns.Button
{
private static readonly string m_srcPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
private static readonly string m_gdbPath = Path.Combine(m_srcPath, @"data\data.gdb");
private const string m_fclName = "StateGeom";
private const string m_tblName = "StateTabl";
private const string m_joinFld = "STATE_ABBR";
protected override void OnClick()
{
var fws = OpenWorkspace(m_gdbPath) as IFeatureWorkspace;
var fcl = fws.OpenFeatureClass(m_fclName);
var tab = fws.OpenTable(m_tblName);
var lyr = new FeatureLayerClass { FeatureClass = fcl, Name = fcl.AliasName, Visible = true };
var gp = new Geoprocessor { OverwriteOutput = true, AddOutputsToMap = false };
try
{
var tool = new AddJoin { in_layer_or_view = lyr, in_field = m_joinFld, join_table = tab, join_field = m_joinFld, join_type = "KEEP_COMMON" };
var result = gp.Execute(tool, null) as IGeoProcessorResult2;
if (result.Status == ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded)
ArcMap.Document.FocusMap.AddLayer(lyr);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
private static IWorkspace OpenWorkspace(string gdbPath)
{
var ftype = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGdbWorkspaceFactory");
var wsf = Activator.CreateInstance(ftype) as IWorkspaceFactory;
return wsf.OpenFromFile(gdbPath, 0);
}
}
}