DB2 Provider - updates/CRUD


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I finally got connected to our AS400 using DB2Connect software from IBM, not sure why I need another product to do this but according to IBM I do, and our IBM guy says that isnt a stranger model for them to have. Oh well, moving on.



I am able to use the BO Mapper against my AS400 OS400 DB2 databases,libraries, and tables, map to business objects and use the "read only" type controls like bound textboxes, the SF Maintenance form, ListView, and BrowseDialog, a hug improvement from 2 weeks ago Smile



Now I need to figure out what to set up for updates and CRUD settings, when I try to "save" it blows out saying there is no primekey on the table (which there is). I imaging is is because I have always relied on the DDT to create sprocs for CRUD, and I cant with the DB2 model.



So, where do I go from here? Do I need to create sprocs on the 400 for these? Our in-house 400 guy is an RPM programmer and has never used stored procedures. I nudge along the right direction will be much appreciated.



Licensing for the DB2Connect product is about $500.00 for a sinlge user, or $2,500.00 for 25 named users, if anyone was curious.



Thanks,



Keith

Keith Chisarik
Replies
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I feel dumb asking with all the "of course" language, but can you expand upon this, I do not know how to implement your solution.



Thanks.

Keith Chisarik
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Sure thing Smile

'-- Custom data source class
Public Class MyDb2DataSourceItem
    Inherits MicroFour.StrataFrame.Data.Db2.Db2DataSourceItem

    Public Sub New(ByVal dataSourceKey As String, ByVal connectionString As String)
        MyBase.New(dataSourceKey, connectionString, _
            System.Data.Common.DbProviderFactories.GetFactory("IBM.Data.DB2"))
    End Sub

    Public Overrides Function CreateBlankDbConnection() As System.Data.Common.DbConnection
        Dim conn As System.Data.Common.DbConnection
        conn = MyBase.CreateBlankDbConnection()
        DirectCast(conn, IBM.DB2.Data.DB2Connection).NoJournaling = True
        Return conn
    End Function

End Class

'-- Change the SetDataSources() method in the AppMain.vb to use your new class, not the SF item
Public Shared Sub SetDataSources()
    DataLayer.DataSources.Add(New MyDb2DataSourceItem("", "db2 connection string"))
End Sub

So, create your own class, and all you have to override is the CreateBlankDbConnection().  So, get the connection and modify that journaling property before you return it.

Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K


'-- Change the SetDataSources() method in the AppMain.vb to use your new class, not the SF item





that is the piece I was missing thanks Ben!!

Keith Chisarik
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Aha, glad to set you straight Smile
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