未处理的ArgumentOutOfRangeException的错误 求大神助攻
private void Form3_Load(object sender, EventArgs e){
int flagNum = 0;
string StrDataSetName = "";
flagNum = (this.mainform.cmbLayerName.Text.IndexOf("@"));
StrDataSetName = this.mainform.cmbLayerName.Text.Substring(0, flagNum);
this.lblDataSetName.Text = StrDataSetName;
soLayers layers = this.mainform.axSuperMap1.Layers;
soLayer layer = layers[mainform.cmbLayerName.Text];
soDataset objDt = layer.Dataset;
objDt = layer.Dataset;
soDatasetVector objDtv = (soDatasetVector)objDt;
soRecordset objRd = objDtv.Query("", true, null, "");
axSuperGridView1.Connect(objRd);
axSuperGridView1.Update();
//提取记录数目和字段值和数据集类型
lblDataSetType.Text = objDt.Type.ToString();
lblFieldCount.Text = objRd.FieldCount.ToString();
lblRecordCount.Text = objRd.RecordCount.ToString();
Marshal.ReleaseComObject(layers);
layers = null;
Marshal.ReleaseComObject(layer);
layer = null;
Marshal.ReleaseComObject(objDt);
objDt = null;
Marshal.ReleaseComObject(objDtv);
objDtv = null;
Marshal.ReleaseComObject(objRd);
objRd = null;
}
StrDataSetName = this.mainform.cmbLayerName.Text.Substring(0, flagNum);显示“System.ArgumentOutOfRangeException”类型的未经处理的异常在 mscorlib.dll 中发生 其他信息: 长度不能小于 0。的未处理的ArgumentOutOfRangeException的错误求大神解决