Sql ce 4

Discussion in 'Databases' started by appworkbench, May 17, 2011.

  1. Hello,

    Is SQL CE 4 supported assuming we copy all assemblies required?

    Thanks in advance
  2. Yes. :)
  3. Ray


    Make sure you upload all the required Binaries/Assemblies in your applications Bin folder. We do not have them installed on the servers GAC.
  4. I've copied what I think are the correct binaries to my Bin folder. However, when trying to create the connection, an access denied exception is thrown (see below). Any advice would be appreciated.

    Files copied:

    Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
  5. Are you still getting this error? Can you post a link to the page? Also, can you post your connectionString information?
  6. SQL CE 4 Issue?

    I have a basic ASP.NET 4.0 web form application with Visual Web Developer 2010 Express that is using SQL CE 4. It works fine on my local PC but when I deploy it to hosting the page just times out. I've used the deployable dependencies (http://stackoverflow.com/questions/...ql-ce-4-ctp-to-shared-hosting/6408169#6408169) to ensure all the required SQL CE 4 files are included.

    You can view the application here: http://iwillspe.w02.Winhost.com/LettersPuzzler.aspx (just click the vowel/consonant buttons until 10 letters are selected, wait for the 5 second countdown and then click "Show Results" - at that point the program just waits and then times out).

    The web.config connection string is:

    <add name="WordDatabaseEntities" connectionString="metadata=res://*/App_Code.WordDatabaseModel.csdl|res://*/App_Code.WordDatabaseModel.ssdl|res://*/App_Code.WordDatabaseModel.msl;provider=System.Data.SqlServerCe.4.0;provider connection string=&quot;Data Source=|DataDirectory|\WordDatabase.sdf&quot;" providerName="System.Data.EntityClient"/>

    I've tried all that I can think of so any suggestions would be appreciated - let me know if you need any more info. Thanks.
    Last edited by a moderator: Oct 14, 2015
  7. Im not 100% convinced this is SQL CE related. It is possible, but there is no DB or Entities related error that is thrown. My best suggestion would be to try to narrow down what exactly is causing this.

    1 - Create a separate test app that does a simple write and read to a SQL CE database.

    2 - Put try catch blocks in your code and throw your own exceptions to narrow down what blocks are causing the issue.
  8. Hi there Chuck, thanks for your reply. You are correct, it does not appear to be totally a SQL CE issue.

    The connection is successful and I was able to retrieve a small record set from the database. The query for my application is more complex so I'm wondering whether I am some how exceeding some sort of memory or CPU limit on your server or the server is just too slow to process the query?

    The query returns within a few seconds on my PC at home (Intel Core 2 Due, 2.2GHz, 3GB Ram, 32bit).

    Are you able to check whether any of these are the issue or indicate whether I can check them?

    Is it possible to extend the page timeout from 1 min 15 seconds (that's the length of time it currently times out at) to something longer to help isolate the problem further i.e. to confirm whether it will eventually complete if given enough time?

  9. It is very likely your app pool is recycling mid request. Open a ticket with support and they can check for you.
  10. Hi Chuck, I followed your advice and logged a support ticket and the response was:

    "I checked the servers event log and I found numerous records, where your application pool was being recycled due to the memory threshold of 100 MB.

    You will need to optimize your web application to consume less than 100 MB of the servers memory."

    Unfortunately I don't think I can optomise my application, so that just leaves me with the option of upgrading to the next hosting plan up which has a 200MB memory limit instead of 100MB.

    Thanks for your help in identifying what was going on.
  11. My pleasure.

Share This Page