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


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

Reply
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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Elio Reyes - 18 Years Ago
Edhy Rijo - 18 Years Ago
Elio Reyes - 18 Years Ago
Elio Reyes - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Edhy Rijo - 18 Years Ago
Elio Reyes - 18 Years Ago
Edhy Rijo - 18 Years Ago
Elio Reyes - 18 Years Ago
Greg McGuffey - 18 Years Ago
Chris Diesel - 16 Years Ago
Dustin Taylor - 16 Years Ago
Chris Diesel - 16 Years Ago
Dustin Taylor - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search