Saturday, July 11, 2009

SQL Server Express And Abyss Web Server

Ok, I have an ancient (PIII 850 mhz machine with 1 gig of ram) that I'm using as a test server. I've got Windows XP Pro installed and I'm using the Abyss X1 Webserver instead of the throttled IIS 5 that comes with XP. I ran into one snag though, I couldn't get my ASP.Net app to talk to a SQL Server Express database when I pushed my ASP.Net project from my dev box to the test server. So I fooled around and got it working, probably in a very insecure way, but it will work fine for now. Here is what I did incase this will help anyone.

First, I moved the database from the app_data folder in the web project to somewhere else, probably not necessary but I thought it might help. I also attached to the database using sql server express studio and created a new login name that was different then the one I used on my dev box (did this both for global security users and then added the new user to the instance of the db...again may not be necessary).

From there I himmed and hawed until I came up with a connection string that works. Here it is roughly. Sql server express was installed in a named instance like this-

devbox\sqldev

So my connection string ended in my web.config file for my asp.net project ended up like this.

<add name="somename" connectionString="Data Source=.\sqldev;AttachDbFilename=D:\data\test.mdf;Initial Catalog=reports;User Id=someid;Password=somepassword;user instance=true;Integrated Security=SSPI" />

Hope that helps someone else at least get going.

No comments: