none
Unable to find the requested .Net Framework Data Provider.

    Question

  •  How do I connect to an sdf database? 
    Pointed Server Explorer to 
    C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5\Samples\Northwind.sdf

    and was able to see it just fine. I can also create sdf's just fine. 

    When I drag a grid view, follow the sqldatasource 'configure data source' wizard I successfully can see the data. 

    But, when I play run(f5), I get the following error message. 

    Unable to find the requested .Net Framework Data Provider.  It may not be installed.

    I have followed Oakleafs blog post, http://oakleafblog.blogspot.com/2007/03/orcas-march-ctp-on-vista-database.html

    but realize this is all per-machine specific. Here is my machine.config file, as you can see I am missing Microsoft.SqlServerCe.Client, can someone tell me where to get this? 

    I am using Visual Studio 2008 Proffesional, Service Pack1. 
     <system.data> 
        <DbProviderFactories> 
          <add name="Odbc Data Provider"                         invariant="System.Data.Odbc"                 description=".Net Framework Data Provider for Odbc"                                 type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
          <add name="OleDb Data Provider"                       invariant="System.Data.OleDb"               description=".Net Framework Data Provider for OleDb"                                type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
          <add name="OracleClient Data Provider"            invariant="System.Data.OracleClient"    description=".Net Framework Data Provider for Oracle"                               type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
          <add name="SqlClient Data Provider"                  invariant="System.Data.SqlClient"          description=".Net Framework Data Provider for SqlServer"                            type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
            
          <add name="Microsoft SQL Server Compact Data Provider"   
                     invariant="System.Data.SqlServerCe.3.5"   
                     description=".NET Framework Data Provider for Microsoft SQL Server Compact"                 
                     type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
         <add name="SQL Server Compact Edition Data Provider"       
                    invariant="System.Data.SqlServerCe"          
                    description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition"   
                    type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
        </DbProviderFactories> 
      </system.data> 

    love dot net
    Sunday, February 08, 2009 8:51 PM

All replies

  • Hi,

    Data Provider "Microsoft.SqlServerCe.Client" or "Microsoft.SqlServerCe.Client.3.5" is not for public use and has been removed from machine.config file. The blog needs to be updated.


    I can also see that the Data Provider entry for SQL Compact 3.5SP1 also exists in your machine.config file.

    Please try to repair the VS2008 and then re apply VS08Sp1 and let me know if the issue re appears.

    Thanks & regards,
    Devesh Anand.


    Please click Yes, if my post was helpful.
    Monday, February 09, 2009 4:34 AM
    Answerer
  • I presume you must be having a app.config in your project, can you open it and check if the connection string is fine?
    Post it here, so it can help to understand the problem better.
    SDET, SQL CE. (Please hit Yes if this was the answer to your question)
    Tuesday, February 10, 2009 9:09 AM
    Answerer
  • Thank you for your response. I am short for time, but appreciate your help. I am trying to use a compact database for conducting data-driven unit testing. Please excuse the long time lapse. I will post back quickly after I follow your suggestion of repairing VS08 and then re-applying SP1.

    Thanks again,

    Danny R.
    .NET Enthusiast
    love dot net
    Tuesday, February 10, 2009 2:55 PM
  • Devesh, Hi,

    I appear to have the same issue. I installed retail VS2008, followed by the SP1 update, on a Vista x64 machine.

    When I build an ASP.NET application, the generated Web.config uses providerName="Microsoft.SqlServerCe.Client.3.5" to connect to the .sdf file, and when I try to run the page, the ASP.NET Development Server grumbles, as above, that it is "Unable to find the requested .Net Framework Data Provider.  It may not be installed."

    I repaired VS2008 and reapplied SP1 with no effect, so I uninstalled VS2008, SQL Server Compact and all related components then re-installed clean followed by application of SP1.

    Also no effect. The generated Web.config still uses Microsoft.SqlServerCe.Client.3.5, and the page still doesn't run!

    What should I be seeing when I build an ASP.NET application for local testing that connects to SSCE, if not Microsoft.SqlServerCe.Client.3.5, which you suggest is deprecated? What is going wrong here?

    Rgds.

     

    Wednesday, March 04, 2009 3:31 PM
  • Hmm... I think I may have an answer to my problem.

    Digging a bit deeper, I found that Microsoft.SqlServerCe.Client.3.5 appears in the machine.config in C:\Windows\Microsoft..NET\Framework, but not in the machine.config in Framework64.

    I subsequently found a thread from a couple of years back

    <http://social.msdn.microsoft.com/forums/en-US/linqprojectgeneral/thread/1131880a-28f8-495b-bd89-10984a3380ea>

    where Jomo Fisher writes "What you're running into is that there's no 64-bit SQL CE provider. We need a better error message for this."

    Is this still the case? I guess on Vista x64 the ASP.NET Development Server can't use the 32-bit provider? Please confirm.

    If so, this was a pretty brutal introduction to picking up VS2008 as a total newbie and trying to write 'My First Webpage'!

    And again, if so, what is my simplest route to knocking up some example pages with data access. Do I need SQL Server Express Edition to do this on Vista x64?

    Rgds.
    Wednesday, March 04, 2009 4:30 PM
  • SQL Compact 3.5 SP1 is available for x64, but not supported with ASP.NET. Download from here: http://www.microsoft.com/Downloads/details.aspx?FamilyID=dc614aee-7e1c-4881-9c32-3a6ce53384d9&displaylang=en
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Wednesday, March 04, 2009 4:54 PM
    Moderator
  • Erik,

    Many thanks for your quick response. Can you clear up for me, then:

    Is it expected behaviour with VS2008 SP1 on Vista x64 that if I create a trivial ASP.NET application connecting to an SSCE .sdf file, the generated Web.config will use providerName="Microsoft.SqlServerCe.Client.3.5", as there are several notes on the web saying this provider is undocumented/deprecated and should no longer be used?

    I can also expect that when I run this app it isn't going to work under the ASP.NET Development Server on x64, because a 64-bit Microsoft.SqlServerCe.Client.3.5 is not part of the VS2008 SP1 installation?

    Is that correct? Please forgive my persistence, but I am new to this and trying to get some clarity as there are several conflicting "expert" statements, and I really want to know whether there is something screwed up with my install, or whether out-of-the-box trying to create a simple test ASP.NET application connecting to the bundled SSCE does not work on x64?

    Appreciate your input, and thanks again.
    Wednesday, March 04, 2009 6:59 PM
  • The provider name for SQL Compact 3.5 is: "System.Data.SqlServerCe.3.5". But again, SQL Compact is not supported or encouraged under ASP.NET - look at this for more info: http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlceconnection.aspx
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Wednesday, March 04, 2009 7:35 PM
    Moderator
  • Erik,

    Thanks. But this is where I get confused. I didn't randomly pluck the provider "Microsoft.SqlServerCe.Client.3.5" out of the ether - it appears in the Web.config, as generated by VS2008! Why?

    And when I manually edit this to "System.Data.SqlServerCe.3.5" I get a new error, "SQL Server Compact is not intended for ASP.NET development."

    Beats the hell out of me! Bear in mind I'm not trying to do anything fancy here... just run a trivial ASP.NET example, as generated by a clean install of VS2008 SP1.

    I may cut my losses here and install SQL Server Express. I'm just disappointed that the out-of-the-box experience trying to create an uber-simple example on VS 2008 SP1/Vista x64 appears broken. I assumed that my install was bad or that I was doing something wrong, but that doesn't seem to be the case.

    Thanks, again, for your replies.
    Wednesday, March 04, 2009 7:47 PM
  • I am not sure where teh other provider name came from, but the one I gave you is the correct one. The error is as expected, as SQL Compact is not supported under ASP.NET. Please see the article about sqlceconnection linked above for further explanation and details.
    Erik Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev - http://erikej.blogspot.com Please mark as answer, if this was it.
    Wednesday, March 04, 2009 7:58 PM
    Moderator
  • Yup, thanks. I had read the article, although I hadn't managed to get the

    AppDomain.CurrentDomain.SetData("SQLServerEverywhereUnderWebHosting", true)

    technique to work with the ASP.NET Development Server, but that might be my ineptitude.

    I remain slightly intrigued as to what has gone wrong here, because my 32-bit .NET machine.config lists both SSCE providers (Microsoft.SqlServerCe.Client.3.5 and System.Data.SqlServerCe.3.5), and I suspect that with the Microsoft.SqlServerCe.Client.3.5 provider that VS writes to Web.config, my silly example would have worked fine under Vista x86.

    But the fairly clear message I'm getting then is not to persist with SSCE under x64 ASP.NET, even for trivial local testing of web pages.

    Thanks.

    Wednesday, March 04, 2009 8:10 PM
  • Hmm... well, just to update the story.

    I was curious whether everything would work if not for x64, so I switched to a solidly 32-bit XP SP3 machine, which was also a non-dev machine... it had never had any developer tools installed, so I could be confident the VS installation would be clean.

    Installed VS2008, then SP1 on this 32-bit XP machine with... exactly the same results. Exactly.

    The VS2008-generated connection string in Web.config still reads providerName="Microsoft.SqlServerCe.Client.3.5", albeit that this is apparently private and deprecated!

    And it still doesn't work. Even though we've now eliminated the 'x64' factor. Though I've just noticed the machine.config on this machine does not contain Microsoft.SqlServerCe.Client.3.5. Makes it even more mysterious that this appears as the VS2008-generated connection string!

    So... the ASP.NET Development Server and SSCE don't appear to play nicely in either 32-bit XP or 64-bit Vista.

    Fair enough. It's a minor nuisance as I have to download and setup SQL Server Express, and that needs a service and accounts to be configured, which was something I hadn't wanted to bother with for a tiny training exercise.

    Thanks for your help.
    Wednesday, March 04, 2009 10:27 PM
  • Don't know wheher you are tracking this but I was lucky and read the article and added

    AppDomain.CurrentDomain.SetData("SQLServerEverywhereUnderWebHosting", true)

    in the very early stages of my learning curve and no longer have THAT problem. The automatic writing of a now depreciated reference still has me as amazed as you are although wherever I have seen comments like yours they always seem to provoke blank stares from the 'experts'.

    I use SQLCE without any problems and find it excellent for my project which includes usage in webforms, asp.net and networked access. No one seems to have any problems. There is no way I'm going to distribute a DB that requires servicing etc because I would have any users if I did.

    If however any MS Experts are reading this, my project is growing and if SQLCE can be considered a stepping stone for my users to have to purchase MS SQL they should be happy as that's looking more likely for my power users every day. I think MS and give more time to SQLCE matters (OLE DB for instance).
    Monday, June 08, 2009 6:33 AM
  • Im getting this error trying to create a typed dataset in asp.net using sqlce 3.0.
    I added the magical line of code AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true) in global.asax to supress all errors related to this but the error happens at build time not runtime. Build fails saying "Error 1 Failed to generate code. SQL Server Compact Edition is not intended for ASP.NET development. Path-to-xsd-here 1"

    Is it posible to design and compile a typed dataset using sqlce3.0 in asp.net?

    ps: sorry to bump this old thread but it seems a good place to write this question.
    Tuesday, December 22, 2009 2:07 PM