SqlExpress mdf DB incompatibility - asp.net

I used the ASP.NET (.NET4) default ASPNETDB.mdf database that gets created when using membership, in one of my sites. I then copied the site to the web server. Now it has been running for a while so there is content and comments. But I now need to make changes to the code that will also require extra fields in the db, so I copied the .mdf from the server to my local machine to edit and add the fields(so I didnt lose content etc). But when I run the project after replacing the mdf i get the following error:
"The database
".....APP_DATA\ASPNETDB.MDF" cannot be
opened because it is version 661. This
server supports version 655 and
earlier. A downgrade path is not
supported. Cannot open user default
database. Login failed. Login failed
for user 'Me-PC\Me'.
This confuses me, as it is the exact mdf file that my home VS generated. The server is running the same .NET as I am too, so I dont see why it would have changed anything.
Thanks!

Ok, so it turns out the server was running a different version of MSSql Server 2008 R2 (yeah?) which meant that the db file was getting upgraded, so when it came back to my lowly system it failed. Had to uninstall and reinstall both VS 2008 and SQL Server 2008

Related

The 'msolap' provider is not registered on the local machine

tried looking at other examples on this and am a bit confused. I have 2 web servers that are load balanced and a sql server box (sql 2012). my cube is created on the sql server box (i see it in management studio). when i try to access via my asp.net page i receive the above error.
now, i see the msolap110.dll in C:\Program Files (x86)\Microsoft Analysis Services\AS OLEDB\110 on the sql box. do i need to do something permission wise with the dll or something? do i need to install analysis services on the web server? is there a specific port or something (doubtful as sql is running fine).
connection string is as follows:
"Provider=msolap;Data Source=;Initial Catalog=AutoOLAPAW;Cube Name=SampleCube;"
going to try to force to use MSOLAP.5 but waiting on a republish from our security/deployment group.
this all works fine in dev but my (more secured/stripped down) prod/qa is where i'm seeing the issue. using iis7 on both.
If you are using ADOMD.NET then either set CopyLocal=True on that reference on your ASP.NET source code so Microsoft.AnalysisServices.AdomdClient is deployed with the web app... Or install SQL_AS_ADOMD.msi from:
https://www.microsoft.com/en-us/download/details.aspx?id=49999
If you are using OLEDB then install SQL_AS_OLEDB.msi from that same link.
If you don’t want the SQL2012 version but want the latest then install from here and use Provider=MSOLAP in the connection string (instead of a number like MSOLAP.5).

Establishing connection to SQL Server Error

I opened my web project today and for some reason I could not gain access to my database files. I get the following exception whenever I try to add, edit or refresh my database:
A network related instance specific error occurred while establishing
a connection to SQL Server. The Server was not found or is was not
accessible. Verify that the instance name is correct and that SQL
Server is configured to allow remote connections.
I took a look at my connection string for any spelling errors and deleted my database and replaced it in the folder I had it in. I can't seem to find a fix for this so any help would be a appreciated. I am using Visual studio 2008 for this web project.
This sounds like the same problem that I had myself awhile back. My problem was that my SQL service pack 1 did not install properly so I had to install Microsoft SQL Server System CLR Types, Microsoft SQL Server 2008 Management Objects and Microsoft SQL Server 2008 Native Client. After that I could create new SQLdatasources but I could not edit the ones I had previously before my problem. I had to restart my computer in safe mode and delete my SQLEXPRESS folder then recreate the database connection in visual studios. When I finished that everything worked fine.
This is the site I got those downloads, http://blogs.cametoofar.com/post/cannot-load-file-or-assembly-microsoftsqlservermanagementsdksfc.aspx

Problems deploying ASP.NET 4 app to Web Server

I just created my first ASP.NET Version 4 app using Visual Studio 2010 and SQL Express 2008.
I copied the files to IIS and run the default.asp. This loads the programs main menu. So far so good.
When I open the read webform and do a read of my database I get the following Error:
Server Error in '/Diary' Application.
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
Any idea how to fix this error?
Did you look at support articile for the very issue.
Or even this

asp.net SQL server error

I am getting following error when I run my website on my laptop which i created on another computer
The database 'C:\DOCUMENTS AND
SETTINGS\ASIF\DESKTOP\APP\WEBSITE\APP_DATA\DB.MDF'
cannot be opened because it is version
661. This server supports version 612 and earlier. A downgrade path is not
supported. Could not open new database
'C:\DOCUMENTS AND
SETTINGS\ASIF\DESKTOP\APP\WEBSITE\APP_DATA\DB.MDF'.
CREATE DATABASE is aborted. An attempt
to attach an auto-named database for
file C:\Documents and
Settings\asif\Desktop\App\Website\App_Data\DB.mdf
failed. A database with the same name
exists, or specified file cannot be
opened, or it is located on UNC share.
Please suggest me solution to this.
Regards,
Asif Hameed
Version 661 is SQL Server 2008 R2. You are trying to attach a database created with this version to an earlier version of the engine, which is not allowed.
Are you trying to use a SQL Server 2008 R2 database in SQL Server 2005? They are not backwards compatible.
See http://forums.asp.net/p/1560835/3859344.aspx and http://social.msdn.microsoft.com/Forums/en/sqlexpress/thread/2744a003-d61c-4d3d-93c2-af946e141e7e.
Edit
Also, if you have multiple SQL Server engines installed, make sure connection is pointing to the correct one. It might be an instance name like computername\instance instead of just computername.

SQL server won't open DB created by Visual Studio

I've built an ASP.Net site in Visual Studio, and created the DB inside it (the .mdf file is in the APP_data folder).
Now, when I want to deploy in the customer site, I think about maintaining the DB without open Visual Studio, and by using the SQL Server Express tools (back up etc.).
I've searched how to do this, and learned that I should attach the .mdf file to sql server.
I've tried to do this and failed!
The error is: Unable to open the physical file "< .mdf >". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (Microsoft SQL Server, Error: 5120)
Google didn't helped me to solve the problem.
Now I have 2 options:
1. To give up and deploy the site in the current situation where the DB is an .mdf file and ASP.Net can connect to it by the SQL server express compact (in the proccess).
To extract all the data (I need to think how...) and import it to new DB, this time in SQL Server DB.
Wat would you recommend doing?
Thank you in advance.
If on Windows Vista or higher, try opening SQL Server Management Studio by right clicking and saying "Run as Administrator". As Mitch mentioned maybe it is just a permissions issue. Then try attaching to the database.
Error 5 is usually permissions related. Do you have permissions to access the file in it's location?
If you've created it in Visual Studio, it's most likely an Express database. SQL Server does not support "user mode" database connections which SQL Server Express use. Despite sharing a name, they are two fairly distinctive and different technologies.
To view the contents of an SQL Express database (ie- created in Visual Studio) I just use the Visual Studio server explorer.

Resources