| | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 06/12/2008 10:28:41 AM Posts: 303, Visits: 434 |
| | When I setup the PopulationDataSourceSettings on a combo box, I am trying to use a FillAll function which return the count of records in the BO after the fill. I dont care about the return value when filling the combo, but I still want to use the FillAll function to fill it. However, it's not available in the Method to Execute dropdown unless it's a Sub. Is there anything that can be done about this or some reason it is like this that I'm not understanding? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 8:47:41 AM Posts: 4,104, Visits: 4,175 |
| | The only reason it would not show up is if it is a private method or if you store the assembly in which it resides in the GAC. In the case of it being in the GAC, close down Visual Studio and come back in and it should then be available...AFTER you have sucessfully built the project in which the BO resides. |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 06/12/2008 10:28:41 AM Posts: 303, Visits: 434 |
| | I don't use the GAC for my assemblies, so I don't think that's the issue. The function was definitely Public, not Private. That was the first thing I checked. I built, rebuilt, closed VS and opened it back about 3 or 4 times just to be sure I wasn't crazy. It never showed up in the dropdown. Then I just changed it from a Function to a Sub, built my BO library, and presto, it showed up in the dropdown. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 8:47:41 AM Posts: 4,104, Visits: 4,175 |
| When it was a Function did it have a return value? If not that could have prevented it from appearing. At any rate, glad you got it working! |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 06/12/2008 10:28:41 AM Posts: 303, Visits: 434 |
| | Well, it did have a return value as a Function...functions are required to have return values, but in this instance I don't always need to use the return value. I do have it working as a Sub, but I would really like to be able to use Functions in here as well. I may have a FillAll that I would like to sometimes use and get back the count which I want to use in a dropdown. I can't use it there as it is right now. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 8:47:41 AM Posts: 4,104, Visits: 4,175 |
| functions are required to have return values In C# that is true 100% of the time. It sounds like you have your project setup correctly, but it is actually possible to omit this in VB....and then problems will occur. The other thing that you can do in VB.NET, which is frustrating, is omit a return statement since by default is has a reference value to itself for backward compatability....wish you could force BOTH of these things to a compiler error no matter what! |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 06/12/2008 10:28:41 AM Posts: 303, Visits: 434 |
| | Ok, I get what you are saying. However, I have a return value explicitly set. My code looks like the following: Public Function FillAll() as Long BO.FillDataTable("SELECT * FROM MyTable") Return BO.Count End Function Please let me know what I'm missing here. I'm a little confused after all the back and forth. |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 3:22:13 PM Posts: 329, Visits: 1,991 |
| | Trent, I ran across the same thing recently. The Method to execute dropdown does not show functions only methods.  |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Toda
|
| |
|