Fill method to select all records where fk value not in a list of integers passed in


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Actually, I want to fill a checkedlistbox which is getting its data directly from a fill method in the TemplatesBO.



Currently it is just doing a fillall()



(though I'd still like to know a how to of the previous BO / BO question )



Now, I have a PDFsBO that just represents selected records (same scenario as first question)



Now I want to write a fill method to fill the second checked listbox "Templates" so that no item comes from a record that has a pk matching an itemplateskey found in PDFsBO



I assume I need to pass in a list (or array?) of itemplateskeys found in pdfsBO.



But what is the "Select " statement for the fill that will select only records "where ikey not in (select itemplateskey from parameterarray)")







Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
The brute force way is to build a list of PKs from the checked listbox that you then use in a select query.



'-- Build list of selected generated PDFs by

'   looping through selected items in checked list box

...



'-- Build Select

Dim selectSql = "Select * From Templates Where TemplateID Not In(" & selectedPks & ")"





Likely, you'd generate the list of selected PKs in the form and pass that list to a Fill method in the BO.



Hope that makes sense...
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
It does indeed and that is the direction I was headed before I heard the siren song of LINQ. I am going to mess with both approaches, as I'm sure each will come in handy at one time or another.



By Tuesday I may have LINQ chops to show you Smile (ordered a couple of books as I can see where LINQ to objects can be kind of cool. Beth Massey has a couple of nice aggregation examples on her blog)
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Charles,



Be aware that LINQ requires .NET 3.0 or 3.5, and there is a size difference between .NET 2.0 runtime and the newest one.

Edhy Rijo

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)Advanced StrataFrame User (938 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Thanks Eddy



I'm specing everything against 3.5 and SQL 2008. No reason to be backward compatible with anything.



Is the size of the run-time an issue?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is the size of the run-time an issue?

Not unless you have download or install limitations.  In most environments this should not be an issue.

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