Calling a Generic BO


Author
Message
Terry Bottorff
Terry Bottorff
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
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.......


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search