我是 .Net 的新手,不知道如何解决我的大部分问题。这是我的问题。我创建了一个表单来执行脚本列表。数据将来自数据库。我的问题是,当我调试时,我得到了NullReferenceException
这段代码的错误
private void Load_RefreshForm_ScriptMgmt()
{
try
{
SqlCommand ObjCmd = new SqlCommand();
SqlConnection ObjConn = new SqlConnection();
this.Ds_Settings1.Tables["Settings_RefreshForm_ScriptMgmt_SelectALL"].Clear();
ObjConn.ConnectionString = this.MainConnection;
ObjCmd.CommandType = CommandType.StoredProcedure;
ObjCmd = new SqlCommand(this.da_LoadScripts.SelectCommand.CommandText.ToString(), ObjConn);
this.da_LoadScripts.SelectCommand = ObjCmd;
this.da_LoadScripts.Fill(this.Ds_Settings1);
}
catch (Exception exception)
{
ProjectData.SetProjectError(exception);
this.DisplayOnly_ErrorHandler("ERROR LOADING REFRESH SCRIPTS ", exception.Message, MsgBoxStyle.Critical);
ProjectData.ClearProjectError();
}
}