soupapes 0 Report post Posted July 24, 2007 Viva! Estou com o seguinte problema que passo a explicar: Criei um site ASP.NET com base de dados SQL. Enquanto compilo e corro o projecto no meu computador consigo criar utilizadores e logar correctamente. Entretanto coloquei o projecto num servidor em Windows Server 2003. O site corre sem problemas e tenho uma data grid view que vai consultar dados à BD e os mostra correctamente. No entanto quando tento criar um novo utilizador apresenta-se uma nova página de erro com a seguinte mensagem: Failed to update database "C:\WEBSITES\FORHM\APP_DATA\ASPNETDB.MDF" because the database is read-only. 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.Data.SqlClient.SqlException: Failed to update database "C:\WEBSITES\FORHM\APP_DATA\ASPNETDB.MDF" because the database is read-only. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Se tentar fazer login dá-me erro de tentativa de login falhada. Alguém faz ideia de qual seja o meu problema. Será que no Web Config tenho a Connection String mal definida? A que estou a usar é esta: <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings> Share this post Link to post Share on other sites
Tiago Salgado 2 Report post Posted July 24, 2007 Cheira-me a permissões mal definidas após copiares o site para o servidor. Tenta verificar as permissões da aplicação, e ve no IIS se tá tudo configurado a nivel de autenticação. Share this post Link to post Share on other sites
Saco 0 Report post Posted August 4, 2007 A mensagem de erro parece-me bastante clara ... the database is read-only. Ou seja só podes LER e não ESCREVER. Agora a questão é: se tentares escrever noutra tabela consegues? Normalmente o que terias que fazer seria dar permissões de escrita no ficheiro da base de dados. Share this post Link to post Share on other sites