I am very new in .Net and not sure how to resolve most of my problems. Here's my issue. I created a form to execute a list of scripts. The data will come from a database. My problem is when I debug I get the NullReferenceException
error on this block of code
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();
}
}