#1
  1. Business Analyst
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2004
    Location
    The 'Ville
    Posts
    1,087
    Rep Power
    22

    Using .NET SqlDataSource


    I'm able to use the FirebirdSql.Data.FirebirdClient DLL with no problems in the code-behind for my ASP.NET application but I'm having trouble getting the SqlDataSource in the markup to work.
    Code:
    <connectionStrings>
    		<add name="rackdb" connectionString="Server=localhost;User=rackdba;Password=rackdba;Database=|DataDirectory|\RACKDB.FDB" providerName="FirebirdSql.Data.Firebird"/>
    	</connectionStrings>
    The above connection string does work when I use FbConnection, FbCommand, etc in the code behind.

    I have done THIS (with the correct version - I'm using 2.5.1.0).

    I have tried this:
    Code:
    <asp:SqlDataSource runat="server" 
                    ID="dsFbRack" 
                    ConnectionString="<%$ ConnectionStrings:rackdb %>" 
                    SelectCommand="select * from test" />
    but I get this error (after a pretty long wait - my guess is because I didn't specify a provider it assumes MS SQL Server):
    Code:
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
    And also with the provider name like this:
    Code:
    <asp:SqlDataSource runat="server" 
                    ID="dsFbRack" 
                    ConnectionString="<%$ ConnectionStrings:rackdb %>" 
                    ProviderName="<%$ ConnectionStrings:rackdb.ProviderName %>" 
                    SelectCommand="select * from test" />
    but I get this error:
    Code:
    Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
    Can anyone provide any suggestions on getting the SqlDataSource to work with Firebird? According to THIS it's possible, but they don't specify a provider. I have looked at every resource I can find. All of the web.config and machine.config stuff seems to show that I have the right version and public token key, etc. Just stumped! The connection string must be right if the code-behind stuff works.

    Thank you!
    Discontent is the first necessity of progress. - Edison
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
    Originally Posted by mateoc15
    ... According to THIS it's possible, but they don't specify a provider. ...
    Check the rest of that website, they do specify a provider, see http://firebirdsql.org/firebirdtutorial/storing-connection-string-in-web-config.html
    In the page you linked they name
    Code:
    ConnectionString="<%$ ConnectionStrings:mydb %>"
    and in the page I linked
    Code:
    <connectionStrings>
        <add
          name="mydb"
  4. #3
  5. Business Analyst
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2004
    Location
    The 'Ville
    Posts
    1,087
    Rep Power
    22
    Ok, here's the deal. My connection string had provider FirebirdSql.Data.Firebird previously. That does work (for some reason) for the code-behind, but does not work for the SqlDataSource in the markup. Using FirebirdSql.Data.FirebirdClient does work for the markup, and (oddly) does work for the code-behind also.

    Issue resolved!

    Thanks for pointing me in the right direction.

    P.S. - you do have to specify the provider in the SqlDataSource (at least as far as I can tell).
    Discontent is the first necessity of progress. - Edison
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Posts
    39
    Rep Power
    8
    hello all,
    sorry i have problem like that too.
    may i ask the solution? i have stuck for 2 day same like that problem and can't connect asp.net to firebird

    thx

IMN logo majestic logo threadwatch logo seochat tools logo