开发右键图层菜单,显示图层属性表,直接添加的数据可以显示,但是添加地图间接添加的数据不能显示,提示未将对象引用设置到对象的实例。求解答
private void toolStripMenuItemData_Click(object sender, EventArgs e)
{
WorkspaceTreeNodeBase node = workspaceControl1.WorkspaceTree.SelectedNode as WorkspaceTreeNodeBase;
WorkspaceTreeNodeDataType type = node.NodeType;
Dataset dataset = node.GetData() as Dataset;
DatasetVector datasetvector = dataset as DatasetVector;
Recordset recordset = datasetvector.GetRecordset(false, CursorType.Dynamic);
dataview Form = new dataview(recordset);
Form.Show();
}