title: Executing an SQL statement in C#?
body: <p>Hey guys i want to execute my SQL statement but im having synatx trouble, can someone help me understand what i doin wrong please?</p>
  
  <p>Thanks, Ash.</p>
  
  <pre><code>public void AddToDatabase(string[] WordArray, int Good, int Bad, int Remove)
  {
  
      for (int WordCount = 0; WordCount &lt; WordArray.Length; WordCount++)
      {
          string sSQL = "INSERT INTO WordDef (Word, Good, Bad, Remove) VALUES (" + WordArray[WordCount] + ", " + Good + ", " + Bad + ", " + Remove + ")";
  
          Debug.Print(sSQL);
  
          //Private m_recordset As ADODB.Recordset
          //Private m_connection As ADODB.Connection
          ADODB.Recordset RS;
          ADODB.Connection CN ;
  
  
          CN = new ADODB.Connection();
          RS = new ADODB.Recordset();
  
          CN.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
  
          CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=doom_calc_dict.mdb;jet OLEDB:database";
          CN.Open(CN.ConnectionString,"","",0);
  
          object dummy = Type.Missing;
  
          CN.Execute(sSQL,out dummy,0);
  
          RS.Close(); 
          CN.Close(); 
  
          //string sSQL = "SELECT Word FROM WordDef WHERE Word='" + WordArray[WordCount] + "'";
          DatabaseTools.LoadDataFromDatabase(sSQL);
          //DatabaseTools.LoadDataFromDatabase(sSQL);
  
      }
  }
  </code></pre>