locked
Deploy web api with sqlce database RRS feed

  • Question

  • User-1899970959 posted

    Hi,

    I am using sqlce database in my rest service.I have placed sqlce4.0 database in app_data folder and included all sql ce dlls in my bin folder.

    Now if i publish this service to the iis server where sql server compact 4.0 is installed then its accessible but its not accessible where sqlserver compact 4.0 is not installed.

    even I have included all sql ce dlls then also its giving me error saying File or directory not found.

    I have gone through this link also : http://msdn.microsoft.com/en-us/library/aa983326(v=vs.110).aspx

    But no Luck !!! 

    Could anyone tell me that sql server compact installation is really necessary as our client wont like to have all the s/w installed to access db. There must be some other dlls.

    Really looking forward for your reply.

    Thanks!!!!

    Thursday, December 19, 2013 7:31 AM

Answers

  • User-1454326058 posted

    Hi Kavita,

    Based on the link that you mentioned, it says that we can use the Private file-based deployment way. (Just deploy the SQL Server Compact DLLs)

    So, I think the SQL Server Compact isn’t necessary installed in the server.

    Please follow those steps and try again. (Just included all dlls in the bin folder is useless)

    1. To open the Project Designer, in Solution Explorer/Database Explorer, double-click My Project if you are working on a Visual Basic project (or Properties if you are working on a C# project).
    2. Click the Publish tab.
    3. Click Prerequisites and then clear the check box for SQL Server Compact.
    4. Close the Project Designer.
    5. Go to the directory that contains the SQL Server Compact DLLs. These are located in C:\Program Files\Microsoft SQL Server Compact Edition\v4.0.
    6. Select the seven SQL Server Compact DLLs and copy them:

    Sqlceca40.dll

    Sqlcecompact40.dll

    Sqlceer40EN.dll

    Sqlceme40.dll

    Sqlceoledb40.dll

    Sqlceqp40.dll

    Sqlcese40.dll

    1. Paste the DLLs into the project in Solution Explorer/Database Explorer.
    2. Select all seven DLLs in Solution Explorer/Database Explorer and open the Properties window.
    3. Set the Copy to Output Directory property to Copy if newer.
    4. This will replace any earlier DLLs in an existing application with the newer ones if the application is updated.
    5. Click the Show All Files button in Solution Explorer/Database Explorer.
    6. Expand the References node.
    7. Select System.Data.SqlServerCe.
    8. Set the Copy Local property to True.
    9. Because your development computer has the SqlServerCe DLLs in the global assembly cache, you must configure the application to use the DLLs in the output directory.
    10. Right-click the project in Solution Explorer/Database Explorer and select Publish to open the Publish Wizard.
    11. Complete the wizard to publish the application.

    If you still have the issue, please provide the detail error message.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 20, 2013 1:07 AM

All replies

  • User-821857111 posted

    its giving me error saying File or directory not found.

    What line of code throws that error?

    Thursday, December 19, 2013 11:45 AM
  • User-1454326058 posted

    Hi Kavita,

    Based on the link that you mentioned, it says that we can use the Private file-based deployment way. (Just deploy the SQL Server Compact DLLs)

    So, I think the SQL Server Compact isn’t necessary installed in the server.

    Please follow those steps and try again. (Just included all dlls in the bin folder is useless)

    1. To open the Project Designer, in Solution Explorer/Database Explorer, double-click My Project if you are working on a Visual Basic project (or Properties if you are working on a C# project).
    2. Click the Publish tab.
    3. Click Prerequisites and then clear the check box for SQL Server Compact.
    4. Close the Project Designer.
    5. Go to the directory that contains the SQL Server Compact DLLs. These are located in C:\Program Files\Microsoft SQL Server Compact Edition\v4.0.
    6. Select the seven SQL Server Compact DLLs and copy them:

    Sqlceca40.dll

    Sqlcecompact40.dll

    Sqlceer40EN.dll

    Sqlceme40.dll

    Sqlceoledb40.dll

    Sqlceqp40.dll

    Sqlcese40.dll

    1. Paste the DLLs into the project in Solution Explorer/Database Explorer.
    2. Select all seven DLLs in Solution Explorer/Database Explorer and open the Properties window.
    3. Set the Copy to Output Directory property to Copy if newer.
    4. This will replace any earlier DLLs in an existing application with the newer ones if the application is updated.
    5. Click the Show All Files button in Solution Explorer/Database Explorer.
    6. Expand the References node.
    7. Select System.Data.SqlServerCe.
    8. Set the Copy Local property to True.
    9. Because your development computer has the SqlServerCe DLLs in the global assembly cache, you must configure the application to use the DLLs in the output directory.
    10. Right-click the project in Solution Explorer/Database Explorer and select Publish to open the Publish Wizard.
    11. Complete the wizard to publish the application.

    If you still have the issue, please provide the detail error message.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 20, 2013 1:07 AM