0

I can connect with the sa user via Enterprise Manager and Query Analyzer. I created the .dbml file and connection string in Visual Studio 2008 then manually imported it into the Visual Studio 2010 ASP.Net MVC3 project.

I was under the impression that this was an accepted way to work with a SQL Server 2000 database in VS 2010.

I have copied the connection string to the Web.config in the ASP.Net website.
Here is the stack trace

I'm not sure what the problem is at all. I'm hoping that it ISN'T because VS 2010 projects will NEVER be able to connect to a SQL Server 2000.

EDIT
Connection string is

<add name="MobiledbConnectionString" 
     connectionString="Data Source=JAMESWRIGHT2771\SQLLOCAL;Initial Catalog=mobiledb;User ID=sa;Password=MYPASSHERE"
     providerName="System.Data.SqlClient" />

Obviously MYPASSHERE is where my password goes.

7
  • 3
    The problem is in your stack trace: Login failed for user 'sa'. SQL is telling you the password is wrong (or access is disabled, or something similar). So you are connecting to the SQL server. Is it possible the password was encrypted in the web.config previously? Aug 21, 2012 at 13:46
  • Nope, the password is correct in the Web.config and not encrypted. Aug 21, 2012 at 13:47
  • 2
    VS 2010 can definitely use SQL Server 2000 - no problem (other than that SQL Server version being really old and creaky and lacking tons of useful features....)
    – marc_s
    Aug 21, 2012 at 13:49
  • 1
    Can you please show us the connection string you're using?
    – marc_s
    Aug 21, 2012 at 13:50
  • 1
    fyi - you're less than 8 months away from the official end of life for sql server 2000 (April 8,2013) After that point, they won't even patch critical security issues any more. In other words, it's time to start moving to at minimum Sql Server 2005 now. Aug 22, 2012 at 2:20

3 Answers 3

1

Not sure if it's related and perhaps a bit late but I added the option 'Persist Security Info=True' to my connection string and it did the trick.

0

AFAIK, the communications haven't changed -- it is quite backwards compatible. What you might try and do within the database changed quite a bit though. IE, linq to sql's schema generation might do some things that Sql 2000 doesn't like unless it has a compatibility mode for that model.

You will often get this error when the database you are accessing does not exist. Have you created it yet?

1
  • Yes the database is created, and Linq to SQL was released when SQL Server 2000 was still in heavy use so it should work fine. Aug 21, 2012 at 13:56
0

I figured out the issue, though I've never dealt with this thing before.
When I import the dbml file into VS 2010 it is being put into a "Class Library" project and for some reason it is using the Connection String that is in a "Settings.settings" file and NOT the one in the app.config or Web.config files (I verified by completely removing the Web.config and app.config Connection Strings).

I have never heard of this Settings.settings file, but I have it working at the moment by changing that value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.