Getting the provider type


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
How do I get the provider type from the data source?  I would like to know whether I am looking at a SQL, Oracle, DB2, etc. database.  Also, is there any way other than parsing the connection string to get out the Server, Database Name, User ID, and Password? 
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
There are several options.  You can test on the data source type to determine which provider is being used based on the type of object which would probably be the easiest.

Dim loType As System.Type = MicroFour.StrataFrame.Data.DataBasics.DataSources.Item("").GetType()

        If loType Is GetType(MicroFour.StrataFrame.Data.SqlDataSourceItem) Then
            MsgBox("SQL Server")
        ElseIf loType Is GetType(MicroFour.StrataFrame.Data.OracleDataSourceItem) Then
            MsgBox("Oracle")
        ElseIf loType Is GetType(MicroFour.StrataFrame.Data.VfpDataSourceItem) Then
            MsgBox("VFP")
        ElseIf loType Is GetType(MicroFour.StrataFrame.Data.AccessDataSourceItem) Then
            MsgBox("Access")
        End If

 

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