Below is my entire class that I am using, I have two questions, 1 is this the proper use of Dispose() and also, why am I getting the error No Overload for method 'dispose' takes 1 argument.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Crawler { class LoggingClass : IDisposable { public void GenericLogging(string systemMsg, string SystemClass, string SystemSection, string ID, string FixID, string baseURL, string mysqlQueryName, string mysqlQuery) { string Loggingall = " insert into tblLogs " + "set SystemMsg='" + systemMsg.Replace("'","''") + "'" + ",SystemClass = '" + SystemClass.Replace("'", "''") + "'" + ",SystemSection = '" + SystemSection.Replace("'", "''") + "'" + ",ID = '" + CarID.Replace("'", "''") + "'" + ",FixID = '" + FixID.Replace("'", "''") + "'" + ",baseurl = '" + baseURL.Replace("'", "''") + "'" + ",mysqlqueryName = '" + mysqlQuery.Replace("'", "''") + "'" + ",mysqlquery = '" + mysqlQuery.Replace("'", "''") + "'" + ",TimeStamp = Now()"; MySQLProcessing.MySQLProcessor MYSQLP = new MySQLProcessing.MySQLProcessor(); MYSQLP.MySQLInsertUpdate(Loggingall, "Loggingall"); } public void Dispose() { Dispose(true); // Take yourself off the Finalization queue // to prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } } }
Here is my updated code: }
Is this the correct way to call it? Do i also have to call the dispose?
IDisposable
at all.