StrataFrame Forum

Add method to BusinessLayer

http://forum.strataframe.net/Topic2030.aspx

By Joe Paquette - 7/31/2006

Create “Protected ReadOnly Property AllFieldNamesStringCollection() As StringCollection” method for use with QueryInformation objects.  Currently, you must use the following construct (C#):

string[] allFields = this.AllFieldsList.ToArray();

queryInfo.Fields = StringBasics.CreateStringCollection(allFields);

 

This should be encapsulated in this new method as follows:

string() allFields = Me.AllFieldsList.ToArray();

return StringBasics.CreateStringCollection(allFields);

 

By StrataFrame Team - 8/1/2006

Joe,

You can add the fields through the AllFieldsList property with one line of code (after the QueryInformation constructor).

QueryInformation info = new QueryInformation();
info.Fields.AddRange(
this.AllFieldsList.ToArray());

There's no need to create another string collection object, since the QueryInformation class is initialized with an empty string collection.  Just AddRange the fields list to an array.

By Joe Paquette - 8/1/2006

Good point!  That works for me.  Thanks.