| | | 
StrataFrame 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 |
| | | | 
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. |
| | | | 
StrataFrame 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 |
| | | | 
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 |
| | | | 
StrataFrame 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? |
| | | | 
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. |
| |
|
|