C#中总是提示并不包含Register方法,请问什么原因?如何解决!
原代码如下: private void btSave_Click(object sender, EventArgs e){
try
{
this.Cursor = Cursors.WaitCursor;
if (!CheckBeforeSave()) return;
WaybillcodeKind objWaybillcodeKind = new WaybillcodeKind();
WaybillcodekindColumns objWaybillcodekindColumns = new WaybillcodekindColumns();
gbSet.BuildColumns(objWaybillcodekindColumns);
DataSet dsSaveResult = objWaybillcodeKind.Register(objWaybillcodekindColumns, GlobalData.OperID.ToString(), "false");//这里总是提示"Leis.View.EnterpriseSupport.WaybillcodeKind"并不包含Register的定义是什么原因啊?怎么解决?
if (DataSetUtil.IsNull(dsSaveResult) || dsSaveResult.Tables.Count < 2 || DataTableUtil.IsNull(dsSaveResult.Tables[1]))
{
string strErroeMessage = string.Empty;
if (dsSaveResult.Tables[0].Columns.Count > 1 && dsSaveResult.Tables[0].Rows.Count > 0)
strErroeMessage = dsSaveResult.Tables[0].Rows[0]["Column1"].ToString();
MessageBox.Show("保存失败" + strErroeMessage, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
MessageBox.Show("保存成功", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
dgvWaybillcodeKind.DataSource = dsSaveResult.Tables[1];
gbSet.SetData(dsSaveResult.Tables[1].Rows[0]);
}
catch (Exception ex)
{
MessageBox.Show("保存失败,失败原因:" + ex.Message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
this.Cursor = Cursors.Default;
}
}
#endregion