internal static void FillReferences(GreyFoxKeyword _GreyFoxKeyword) { StringBuilder s = new StringBuilder("SELECT GreyFoxKeywordChildID FROM kitCms_KeywordsChildren_References "); s.Append("WHERE GreyFoxKeywordID="); s.Append(_GreyFoxKeyword.iD); s.Append(";"); OleDbConnection dbConnection = new OleDbConnection(_GreyFoxKeyword.connectionString); OleDbCommand dbCommand = new OleDbCommand(s.ToString(), dbConnection); dbConnection.Open(); OleDbDataReader r = dbCommand.ExecuteReader(); GreyFoxKeywordCollection references; if (_GreyFoxKeyword.references != null) { references = _GreyFoxKeyword.references; references.Clear(); } else { references = new GreyFoxKeywordCollection(); _GreyFoxKeyword.references = references; } while (r.Read()) { references.Add(GreyFoxKeyword.NewPlaceHolder(_GreyFoxKeyword.connectionString, r.GetInt32(0))); } dbConnection.Close(); _GreyFoxKeyword.references = references; }
public GreyFoxKeywordCollection GetCollection(string whereClause, string sortClause) { StringBuilder query = new StringBuilder("SELECT "); foreach (string columnName in InnerJoinFields) { query.Append("kitCms_Keywords."); query.Append(columnName); query.Append(","); } // // Remove trailing comma // query.Length--; query.Append(" FROM kitCms_Keywords "); // // Render where clause // if (whereClause != string.Empty) { query.Append(" WHERE "); query.Append(whereClause); } // // Render sort clause // if (sortClause != string.Empty) { query.Append(" ORDER BY "); query.Append(sortClause); } // // Render final semicolon // query.Append(";"); OleDbConnection dbConnection = new OleDbConnection(connectionString); OleDbCommand dbCommand = new OleDbCommand(query.ToString(), dbConnection); dbConnection.Open(); OleDbDataReader r = dbCommand.ExecuteReader(); GreyFoxKeywordCollection GreyFoxKeywordCollection = new GreyFoxKeywordCollection(); while (r.Read()) { GreyFoxKeyword GreyFoxKeyword = ParseFromReader(connectionString, r, 0, 1); greyFoxKeywordCollection.Add(greyFoxKeyword); } r.Close(); dbConnection.Close(); return(GreyFoxKeywordCollection); }
public GreyFoxKeywordCollection Clone() { GreyFoxKeywordCollection clonedGreyFoxKeyword = new GreyFoxKeywordCollection(itemCount); foreach (GreyFoxKeyword item in this) { clonedGreyFoxKeyword.Add(item); } return(clonedGreyFoxKeyword); }