How Change TableSchema Programatly ?


Author
Message
Elio Reyes
Elio Reyes
StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)
Group: Forum Members
Posts: 46, Visits: 251
Sorry it works, the problem is when I save usisng the save method bo.save()
Elio Reyes
Elio Reyes
StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)
Group: Forum Members
Posts: 46, Visits: 251
I have the information in a table, how can I OverWrite the all BO Methods with the information in my table, because a do something :



Public Sub FillAll(ByVal cTableSchema As String)



Me.FillDataTable("SELECT * FROM " & cTableSchema & ".OP_OPER_DET_MO WHERE ORDEN_PRODUCCION IN " & _

" (SELECT ORDEN_PRODUCCION FROM " & cTableSchema & ".ORDEN_PRODUCCION WHERE ESTADO='L' ) AND OPERACION = 'GALERA' ORDER BY ORDEN_PRODUCCION")

End Sub




I send to all my filldata the schema, but it does not work.



If you can show me how to averwrite



Thanks SF
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Pedro,

If you are using a base BO you can overwrite the TableSchema property and use whatever schema you want in that method.  I guess you will have the company information somewhere which will be used as the schema. 

Also make sure that any custom FillBy method you create, uses the BO.TableNameAndSchema property.  I have a method I use in all my BOs to get all Records like this:

Public Sub FillAllRecords()

     Using cmd As New SqlCommand()

          cmd.CommandText = String.Format("Select * From {0}", Me.TableNameAndSchema)

          Me.FillDataTable(cmd)

     End Using

End Sub



Edhy Rijo

Elio Reyes
Elio Reyes
StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)
Group: Forum Members
Posts: 46, Visits: 251


HI



I'm using a 3rd party database, in the database design they put Schema as a company and in my SF application I have to change depends to the company I going to work to, but I do when I fill the BO and it still using the TableSchema property made by the BO Build.



Public Overrides ReadOnly Property TableSchema() As String

Get

Return "P_T_P"

End Get

End Property



Any suggestions how to change this are welcome.



Thanks SF

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