StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


123»»»

How to exclude fields in a BrowseDialog...Expand / Collapse
Author
Message
Posted 03/11/2010 9:30:31 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 10:39:38 AM
Posts: 1,590, Visits: 9,189
Hi all,

Is it possible to specified or exclude the fields to be included in a BrowseDialog?

Since a Browse Dialog is assigned to a BO I believe that it will bring all fields in the BO, how to exclude a couple of fields in the SELECT statement so only the ones needed are used in the SELECT Field1, Field2, Field3, etc.?

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #26415
Posted 03/11/2010 10:11:42 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 10:39:38 AM
Posts: 1,590, Visits: 9,189
Forgot to mention that I know I can create a view for this but is there another way to get this done?, I prefer not to use a view and handle this by code if possible.

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #26417
Posted 03/11/2010 10:44:38 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 2 days ago @ 7:16:53 PM
Posts: 78, Visits: 587
Edhy -

Hello.

So, you can control the fields that the BD shows to the user as search fields, as well as the ones that are displayed in the resulting list once the user performs a search.

I guess I am a bit confused (which probably means I will learn something here) as to what the goal is. When the BO that is to be populated from the BD is populated, it will use only those columns that it needs, even if the BD contains additional ones (as when a view is used to override the source of the BD). Are you asking this from a performance point of view?



________________
_____/ Regards,
____/ al
Post #26418
Posted 03/11/2010 10:54:11 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 10:39:38 AM
Posts: 1,590, Visits: 9,189
Alex Luyando (03/11/2010)
...When the BO that is to be populated from the BD is populated, it will use only those columns that it needs, even if the BD contains additional ones (as when a view is used to override the source of the BD). Are you asking this from a performance point of view?


Hi Alex,

Based on my testing, you are wrong, the Browse Dialog will use all the fields in the BO as part of the SELECT statement.

When you create a BO and assign it to a BrowseDialog, all the fields in the BO will be use as part of the SELECT statement. In my case I have a Transactions table which have a couple of VARCHAR(MAX) and VARBINARY(MAX) fields, these are only used in a specific form, but the Transactions table is used in many forms, so when customer use a browse dialog, this process is slowed because those (MAX) fields are included in the main transactionsBO.

I am almost sure that the only way around this is using a View to define the specifics fields needed in most cases and then create a BO using this view. I just wanted to make sure there was no other way to avoid having to create the view and maintain it

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #26419
Posted 03/11/2010 11:01:11 AM
Strategic Support Team Member

Strategic Support Team Member

Group: StrataFrame Developers
Last Login: Today @ 9:58:04 AM
Posts: 1,836, Visits: 5,608
Aren't there some events you can use to manipulate the SQL being sent?
Post #26420
Posted 03/11/2010 11:07:02 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 10:39:38 AM
Posts: 1,590, Visits: 9,189
Greg McGuffey (03/11/2010)
Aren't there some events you can use to manipulate the SQL being sent?


I looked at the Searching event, but it does handle the "WHERE" not the fields included or excluded from the BO.

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #26421
Posted 03/11/2010 11:25:46 AM
Strategic Support Team Member

Strategic Support Team Member

Group: StrataFrame Developers
Last Login: Today @ 9:58:04 AM
Posts: 1,836, Visits: 5,608
I'm not seeing anything either Edhy that would allow the fields included in the select to be manipulated.
Post #26422
Posted 03/11/2010 11:29:52 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 10:39:38 AM
Posts: 1,590, Visits: 9,189
Thanks Greg for the confirmation.

I am going with the View route and will do some testing soon, just that I need to do several changes since I want this to be used in all BDs.

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #26423
Posted 03/11/2010 12:12:37 PM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 10:39:38 AM
Posts: 1,590, Visits: 9,189
Ok here my conclusion, a view should be used and in this case of refactoring the source BO for the Browse Dialog it was worthy because in the BrowseResultLayout I need to show some calculated fields which I created using Custom Field Properties and those where also slowing things down a bit, so I decided to create my BrowserDialog view with a JOIN condition to get the calculated fields in a single trip and now getting and showing the data in the Browse Dialog is much faster and responsive.

One caveat to take into consideration using this approach is that after the user selects the record to work with from the BD, I them have to search that PK in the primary BO used in the form which in this case is not the one used in the BD. I know this can be confusing sometimes but in my case it works just fine because searching a record using the BO.FillByPrimaryKey(PKValue) is much faster than looking for many records in the BD which will include those VarBinary or Varchar fields that are not used in the BD.

Hey Alex, hope all this makes sense and if not, please let us know.

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #26424
Posted 03/11/2010 12:14:41 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 10:55:20 AM
Posts: 459, Visits: 18,484
( I'm posting this without thinking it through completely so bear with me if it turns out to be complete nonsense )

For some reason I assumed that if the fill method of a BO did not return all the columns it would generate an error. This doesn't seem to be the case. I just dropped a bo on a form that has a number of Varchar fields etc and in the parentformloading just did a filldatatable to get four columns, excluding varchar, varbinary etc. and I got a cursor.

Couldn't you to that for the BD and then use a different instance of the BO with a full column fill method to get a single chosen record with fillbyprimarykey (or for that matter a set of records)


Post #26425
« Prev Topic | Next Topic »

123»»»

Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trent L. Taylor, Steve L. Taylor, Dustin Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 11:22am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.109. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.