StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
Calling a Generic BO
Calling a Generic BO
Post Reply
Like
0
Calling a Generic BO
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Terry Bottorff
Terry Bottorff
posted 15 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 448,
Visits: 12K
I have a generic BO with the following Sub:
Public Sub FillAllData(ByVal objbo As Object)
Using cmd As New SqlCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = String.Format("Select * from {0}", Me.TableNameAndSchema)
objbo.FillDataTable(cmd)
End Using
End Sub
Then I add a BO to my project called CowboysBO which I make sure Inherits from my generic BO. Then I call the sub using the following:
Me.CowboysBO1.FillAllData(Me.CowboysBO1)
Is my logic OK or should I be doing something else? I will use the sub to fill several different BO's and that is why I thought I needed the objbo. The above code seems to work but I don't want to get Bitten.
TIA.......
Reply
Like
0
Reply
Edhy Rijo
E
Edhy Rijo
posted 15 Years Ago
ANSWER
Post Details
Share Post
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
You are welcome Terry.
I am glad you found the problem. And keep in mind that SF BOs are greatly flexible, extensible and powerful, little by little I found the logic used behind them very nice and worthy specially when working with several projects at the same time.
Edhy Rijo
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Calling a Generic BO
Terry Bottorff
-
15 Years Ago
Hi Terry, You don't need to pass any parameter nor the current BO....
Edhy Rijo
-
15 Years Ago
OK but I think I am having trouble with it filling the correct BO...
Terry Bottorff
-
15 Years Ago
Terry, Your code is using the objbo.FillDataTable(cmd) instead of...
Edhy Rijo
-
15 Years Ago
I had my code just like yours but I was not getting the correct data....
Terry Bottorff
-
15 Years Ago
I found the error that was causing the wrong data to load. Thank you...
Terry Bottorff
-
15 Years Ago
You are welcome Terry. I am glad you foundthe problem. And keep in...
Edhy Rijo
-
15 Years Ago
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search