private bool execCreateTable( String inSqlStmt ) { bool curReturnValue = true; int curDelimIdx, curDelimIdx2, curValueLen; ImportData curImportData = new ImportData(); String[] curTableName = new String[1]; try { curDelimIdx = inSqlStmt.ToUpper().IndexOf( "TABLE " ); if ( curDelimIdx > 0 ) { curDelimIdx2 = inSqlStmt.IndexOf( " ", curDelimIdx + 6 ); if ( curDelimIdx2 < 0 ) { curValueLen = inSqlStmt.Length - curDelimIdx - 6; } else { curValueLen = curDelimIdx2 - curDelimIdx - 6; } curTableName[0] = inSqlStmt.Substring( curDelimIdx + 6, curValueLen ); String curFileRef = Application.StartupPath + "\\" + curTableName[0] + ".tmp"; if ( execSchemaCmd( inSqlStmt ) ) { if ( !( curTableName[0].EndsWith( "Backup" ) ) ) { curImportData.importData( ( curFileRef ) ); deleteTempFile( curFileRef ); } } } } catch ( Exception ex ) { MessageBox.Show( "Error: Executing drop table command " + inSqlStmt + "\n\nException: " + ex.Message ); curReturnValue = false; } return curReturnValue; }
private bool loadTrickList() { bool curReturnValue = true; int rowsProc = 0; try { #region Insert current NOPS values mySqlStmt = myDbConn.CreateCommand(); mySqlStmt.CommandText = "Delete TrickList"; rowsProc = mySqlStmt.ExecuteNonQuery(); String curFileRef = Application.StartupPath + "\\TrickList.txt"; ImportData myImportData = new ImportData(); myImportData.importData( curFileRef ); #endregion } catch ( Exception ex ) { curReturnValue = false; String ExcpMsg = ex.Message; if ( mySqlStmt != null ) { ExcpMsg += "\n" + mySqlStmt.CommandText; } MessageBox.Show( "Error during addVerion optionation" + "\n\nError: " + ExcpMsg ); } return curReturnValue; }