soupapes 0 Posted July 24, 2007 Report Share 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> Link to post Share on other sites
Tiago Salgado 2 Posted July 24, 2007 Report Share 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. Link to post Share on other sites
Saco 0 Posted August 4, 2007 Report Share 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. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now