Thursday, February 16, 2012

After Publish from VS2005 to IIS 5.1, SQLExpress doesnt work

I created an app in vs2005 and everything works perfectly in the development environment. I've published the site to my local IIS, but when I try to log in, it doesn't allow me. I'm assuming that it has something to do with the db not working correctly. Unfortunately I don't know how to debug to see where the problem is coming from now that it's running on my 'live' IIS. Does anyone have any ideas on what could be the problem. I have some settings in the web.config, which have been working perfectly.

<appSettings>
<addkey="UserName"value=""/>
<addkey="Password"value=""/>
<addkey="Server"value="xxxxxx\sqlexpress"/>
<addkey="Database"value="xxxxx_xxx_users"/>
<addkey="UseTrusted"value="True"/>
</appSettings>

I had a local guy at the office here saying that the ASP.NET user needs to be granted access to sqlexpress2005, but I wasn't sure on how to do that.

So all in all, My app works in Visual Studio 2005, and not in IIS. There are no errors when loading various pages. They all load correctly and without error. It seems that it's just when I try to do anything with the DB.

Thanks for the help. I appreciate it!

Have you modified you connection string to point to you IIS database? Are you sure that your provider support SQL express some of them provide space on Full SQL server.

Have you moved your database together with page to new server? If yes it is possible that because ASPNET user database is encrypted with machine specific key your IIS server key will not and you have no access to database.

And it is also true that if you use windows security your ASP account have to have login associated with it on SQL Server.

I hope that it helps a little,

Thanks

|||

Hey thanks for the reply.

Have you modified you connection string to point to you IIS database?
I have not modified the connection string because it is using the same database being used, thus why I don't know why this isn't working.

Are you sure that your provider support SQL express some of them provide space on Full SQL server.?
This is just on my local machine here, and yes, I'm using sqlexpress

Have you moved your database together with page to new server?
Yes, we tried it on our webserver, and the same thing happened

I am using an ASPNET 2.0 login control, but it creates an instance of my user class which authenticates the user directly from my sqlexpress db, which is used in the whole application, and then authenticates based on username and password.

I am using windows authentication.

Ok after doing a little authentication taking out, it turns out that the only thing not working is the login. All the other db queries work perfectly. It's just the login that is failing. I took a look at one of the tutorial videos and noticed that scott went into the ASP.NET Configuration page and created users and member groups there. Does that need to happen? It creates it's own database for users that's pretty locked down. I want to be able to use my own database I created.

Any ideas?

|||

Are all tables working one and login in the same databse? Does you user have rights to connect to them and select from them? does it has rights to excute your stored procedures connected to login?

Thanks

|||It turns out it was the aspnet user access in sql express. I gave the user permission and all is a go now. Thanks for the help!

No comments:

Post a Comment