FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
160 stars 65 forks source link

ADO.NET Provider does not work with DbProviderFactories from System.Data.Common [DNET130] #142

Closed firebird-automations closed 16 years ago

firebird-automations commented 16 years ago

Submitted by: Jos? Augusto Guimar?es (jaugusto)

Assigned to: @carlosga

http://ADO.NET Provider does not work with DbProviderFactories from System.Data.Common

Code to teste on .Net 2.0:

' Form with 2 components ' DataGridViewProviderClass show Firebird on the List ' ListBoxProviders show DbProviderFactories sucssesful Loaded (Firebirdsql Not) ' mailto:email:JAugustoGuimaraes@gmail.com ' Please email to me when ok

Imports System.Data.Common Imports System.Windows.Forms

Public Class FormTesteProvider

Public Function GetFactoriesTable\(\) As DataTable
    Return DbProviderFactories\.GetFactoryClasses\(\)
End Function

Public Function GetFactoriesList\(\) As List\(Of String\)
    Dim Factories As New List\(Of String\)
    Dim FactoriesTable As DataTable = DbProviderFactories\.GetFactoryClasses\(\)
    For Each FactoryRow As DataRow In FactoriesTable\.Rows
        Try
            Dim DbProvider As DbProviderFactory = DbProviderFactories\.GetFactory\(FactoryRow\)
            Factories\.Add\(FactoryRow\.Item\(2\)\.ToString\)
        Catch ex1 As Exception
        End Try
    Next
    Return Factories
End Function

Private Sub FormTesteProvider\_Load\(ByVal sender As System\.Object, ByVal e As System\.EventArgs\) Handles MyBase\.Load
    DataGridViewProviderClass\.DataSource = GetFactoriesTable\(\)
    ListBoxProviders\.Items\.AddRange\(GetFactoriesList\(\)\.ToArray\)
End Sub

End Class

firebird-automations commented 16 years ago

Commented by: @carlosga

Do you have the provider registered on your machine.config file or your app.config file ??

firebird-automations commented 16 years ago

Commented by: @cincuranet

Carlos, I've run this code (rewritten to C#⁠) on my machine and everything works. It's most probably problem in machine.config.

firebird-automations commented 16 years ago

Commented by: @carlosga

Not a bug

firebird-automations commented 16 years ago
Modified by: @carlosga status: Open \[ 1 \] =\> Closed \[ 6 \] resolution: Cannot Reproduce \[ 5 \]