Pergunta

I am using SQL Server CE 4.0 with WebApi on Windows Azure Websites. I have been successfully able to deploy SQL Server CE. The weird problem I am facing is that my site is able to log me in using the same DB but I am not able to use any of the controllers to fetch the data.

I am using same connection string for both. The only difference is that for logging in I am using WebSecurity as I have enabled OAuth on the site.

Can someone throw some light on how to debug and fix this issue? The error I am getting for the calls is

Format of the initialization string does not conform to specification starting at index 0.

However the same string works for authentication, change password, adding OAuth connections etc.

Thanks in advance

Foi útil?

Solução

I connected to the site using FTP. I was not giving the site name as domain name and it was denying me access earlier. On connecting, I got hold of the Web.config file and I found something interesting. While publishing the site, the web.config was modified to add another connectionstring with the name of context_DatabasePublish.

This string had following details connectionString="ContextName_DatabasePublish.ConnetionString" providerName="System.Data.SqlClient"

Also there was a new section called context added to the entityframework section of the config file with all the details for the context to use but again pointing to same connection string. The provider it is using is sql and not sqlce. I believe that is the reason it was failing.

I uploaded my normal config file and the site started working. I need to explore more on to why and how the new connection string got added. I will post the details in comments.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top