Peter,
I think you might have to prime the pump a little bit by configuring the relevant front panel controls on your VI to expect a DataSocket connection before you actually run the VI and assign the connection(s).
For instance, if you've got a graph that you want to use to display data, right-click on the graph, select Data Operations >> DataSocket Connection..., give it some arbitrary URL (I used dstp://localhost/placeholder) that doesn't correspond to any source that you actually plan to use, and save your VI this way. As long as you've done this, it seems that the DataSocket properties are writable at run-time for the control; otherwise, I get a 1087 error ("There is no DataSocket information available for the object.") and the Invalid Status code you described.
It's surprising that there isn't more material about this either on the NI Web site or in the documentation, and it makes me suspect that perhaps we're both still missing something. However, maybe most people are using the full-blown DataSocket open/read/write VIs to manage programmatic DataSocket applications and don't run into this problem as a result.
Regards,
John