Using the WhereStatement


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Sorry about the formatting...apparently, the posts get leading spaces stripped?



Table Structure

.....WorkOrderMaster

..........woindex (PK)

..........partindex (FK)

..........etc.



.....PartMaster

..........partindex (PK)

..........divisionindex

..........etc.
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
(bump)



Table Structure

WorkOrderMaster

woindex (PK)

partindex (FK)

...

PartMaster

partindex (PK)

divisionindex

...



I am trying to limit the browse dialog to only those work orders that have parts in a specific division. The SQL would look like this:



SELECT WorkOrderMaster.* FROM WorkOrderMaster LEFT OUTER JOIN PartMaster ON PartMaster.partindex = WorkOrderMaster.partindex WHERE PartMaster.divisionindex = 1
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Good afternoon!

I have the following code working within a browse dialog.



private void WorkOrderBrowseDialog_Searching(object sender, MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogSearchingEventArgs e)

{

ArrayList mPartArray = new ArrayList();

using (PartsBO mPartsBO = new PartsBO())

{

mPartsBO.FillForComboBox(); // fills list for one division

foreach (PartsBO mBO in mPartsBO.GetEnumerable())

mPartArray.Add(mBO.partindex);

}

WhereStatement mWhere = new WhereStatement(new String[] { "partindex" }, mPartArray, WhereStatementTypeOptions.In);

e.RawWhereStatementsCollection.Add(mWhere);

}




The problem is, like always, speed. There are 1250 parts in the mPartsBO--more in the other division. The delay seems to be building that array. Is there any easier, faster, more economical way to reference the partindex field in the BO collection?



Thanks!

Bill
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search