Get ProductCode from MSI File using DTF in C#
Almost all objects you work with here are disposable so wrapping them with the using would be a good start.
The msiDB variable is not necessary.
It is not necessary now to define the result above the query. Variables should be defined as close to their usage as possible.
We use the _ usually only for private fields not for local variables.
You might consider the implicit type var. It would make your code less verbose.


After applaying this we get:

public static string GetMSIProductCode(string msiFile)
{
    var productCodeQuery = "SELECT * FROM Property WHERE Property = 'ProductCode'";
    using(var product = Installer.OpenPackage(msiFile, true))
    using(var msiView = product.Database.OpenView(productCodeQuery))
    {
        msiView.Execute();
        using (var record = msiView.Fetch())
        {
            return record.GetString(2);
        }
    }
}