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



How do I trap for no records found?Expand / Collapse
Author
Message
Posted 08/28/2006 3:14:15 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
If I attempt to fill a BO and the critera I used returns zero records.... how do I handle that gracefully? Right now I get an error: "Cannont convert "" to integer".

Thanks
Post #2496
Posted 08/28/2006 5:34:30 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 6:26:12 PM
Posts: 4,901, Visits: 4,887
It depends on how you are filling the business object.  All binding logic already takes this into account so basic StrataFrame binding will not generate this error since we remove the binding when there are no records.  But you can use teh CurrentDataTableRefilled method and then look at the Count property of the BO.
Post #2503
Posted 08/28/2006 8:29:25 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
I'm filling the busines object using Me.FillDataTable(cmd). I'll check it out in the morning. Thanks
Post #2513
Posted 08/28/2006 8:32:41 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 6:26:12 PM
Posts: 4,901, Visits: 4,887
Let me know if you have any questions.  We may not have 2 minute responses since we are out of town, but we are keeping on top of the forum
Post #2515
Posted 08/29/2006 7:46:08 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Is there a way I can cancel the ListPopulating event if my primary business object returned zero rows?
Post #2517
Posted 08/29/2006 10:54:34 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 6:26:12 PM
Posts: 4,901, Visits: 4,887
All you need to do is attempt to populate before you call the Requery method of the ListView.  This way the ListPopulating event will never even be called and the list will not attempt to re-populate.  One thing that you will probably want to do is set the PopulateOnFormLoad to manual which means the list will not populate unless you call the Requery method of the ListVIew.
Post #2521
« Prev Topic | Next Topic »


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

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:02pm

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.047. 8 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.