How do I fix SQL server incompatibility? - c#

After installing SQL server from here, I have the folder "C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS" which, according to File Locations for Default and Named Instances of SQL Server | Microsoft Docs[^] means I have the latest 2017 version i.e above 2012.
But the error is impeding me from achieving anything. If I try creating a new database, I get the infamous error "This server version is not supported. Only servers up to Microsoft SQL Server 2012 are supported". I bypassed this tricking visual studio into thinking I'm trying to test my connection but after that, I can't populate the rogue database with tables.
Trying to do this results in abrupt shutdown of visual studio and a request to be debugged. In the error log, I can see the last line read "The target database schema could not be retrieved" which still exposes the illegitimacy of my database. Trying to access that database in Server object explorer also results in the error "Operation is not valid due to the current state of the object".
Also I purchased a CD Microsoft server R2 2012 but ultimately did not install it because it asked me to backup my drive, I fear it may actually reformat my machine or do something else besides simply installing a server. I'm following the instructions on this thread How do I fix incompatible SQL Server version found? and in the drop-down, I can see version 2012 is there already. I also have the SSDT.exe but when I try installing it, it terminates and the error log states the following "MainViewModel.AddFailedCondition: Error: The current operating system is not supported. This application requires at least Windows 7 SP1 or Windows 8.1 to run" whereas I am clearly running windows 8 os.
So how do I go about getting a compatible server for my visual studio 2012? Or how can fix this current state of affairs?

Related

Deploy a project that includes entity framework and sql server 2014

I have Visual Studio 2015, and I am trying to create an installation package for a product of mine for selling purpose.
I have tried Installshield Limited Edition for Visual Studio but with that, the installer can't access the database on my client's computer.
i have installed sql server 2014 on client's computer and attatched the database file to it but i am faced with the following error
I am not sure how to add the Entity Framework library and SQL Server database as they are not picked up or accessed automatically.
From the error message you can clearly see:
.... Login failed for user 'SAWLAIN-PC...'
Your problem is a hard-coded connection string.

Fresh install on new pc visual studio sql error

I have just installed visual studio on a new windows 8.1 PC. When I try to run a new MVC project I get the following error when registring in the default mvc framework:
"Your sql server installation is either corrupt or has been tampered with (unknown package id)."
This is a brand new install and I have tampered with nothing. I saw it typically has to due with renaming your computer, but since this is a fresh install it shouldn't be an issue.
Please try the below mentioned options.
Change the name of the computer where it was originally might sort
this error.
Update the SQL server to the latest version and verify if it is compatible with installed visual studio.
If above option fails, then re-install SQL Server.
This error occurred because it might have got installed alongside with visual studio. Better install the version that is compatible with your system.
http://blog.sqlauthority.com/2009/05/28/sql-server-fix-error-sqldumper-library-failed-initialization-your-installation-is-either-corrupt-or-has-been-tampered-with-please-uninstall-then-re-run-setup-to-correct-to-correct-this-problem/
Fix/Workaround/Solution:
Go to Add/Remove Program in windows Control Panel
Remove “microsoft SQL server vss writer” program
Reboot the computer.

SQL Server express edition in windows application - error message -26 A network-related or instance-specific error occurred

I am very new to programming. I created a windows application. Used SQL Server database as the DB for it (My application is really a small one having just 2 screens and 2 tables). I have copied the db file in the folder with executable, and connection string is pointed to it. In the computer I created this application, everything works fine(VS 2005, C#, Windows XP). it works fine in different discs of same machine. Now, when I copy it into another computer (Windows 7 Home premium) and open the exe file, I get the error message Why?
Is it that I am using the wrong database? I wanted a mbile DB which can be deployed with the application, without installing it on the machine. Should I move to Access DB or SQL Server Compact edition?
Check the authentication for the user. on the other machine you may have different user credentials. Try to show your connectionstring that may give idea what is going on
Are you using the SQL Server Compact edition database file (sdf) or a standard SQL Database file (mdf). I have had a number of problems using .sdf files with Visual Studio Express.
Does new machine has MS SQL Installed?

Unable to connect to Sql Server Express database

I installed Sql Server Express 2008 R2, and created a database file in Sql Server management Studio. Now From Visual Studio 2008 I try to connect, but it fails with error:
Unable to open the physical file
"C:.....mdf". Operating system error
32: "32(The process cannot access the
file because it is being used by
another process.)". An attempt to
attach an auto-named database for file
C:....mdf failed. A database with the
same name exists, or specified file
cannot be opened, or it is located on
UNC share.
...This is first time I use Express. I only used Sql Compact Edition before. Are there some settings here I need to figure out? It's not a duplicate name of other connection, and I have closed management studio completely. Still this error. What am I missing..?
If there are some settings, please give a little detail how I access them, as I'm not used to dealing with databases.
SQL CE is a file based database - SQL Express isn't.
It is a SQL Server - you can add it using the Server Explorer in Visual Studio.
The instance name is normally .\SqlExpress.
I faced the same issue today, and guess what daemon tools was the reason for this problem, so if you have installed daemon tools uninstall it and then try again.
Hope it solves your problem too.
You do not want to be connecting using the mdf. What you want to do is Open a SqlClient.SqlConnection and then using the SqlClient.SqlCommand execute queries on the database, and then read the information using the SqlClient.DataReader, just like you would with A SqlCE database.
If you are trying to add it to the Server Explorer you just need to connect to the database just like you would in SSMS (Management Studio) and then you can use it in your project.
If you created a database in SQL Server, you probably have it attached. In Visual Studio you cannot access this database as a file. You have to access it as an attached database (i.e. by its name).
Generally you can use database in files as well in Express edition. If you for some reason want to use file directly, then go to Management studio, right click on your database and detach it. Then you can connect to it from Visual Studio on file basis.

Microsoft.ExceptionMessageBox not being "found"

I have a winform solution that I deploy through clickOnce. There is the Main Project and then a Project called psWinForms. That project has a Reference to Microsoft.ExceptionMessageBox that I use in my custom error reporting.
I have psWinForms as a reference in my Main Project with Copy Local = True.
I have Microsoft.ExceptionMessageBox as a reference in psWinForms with Copy Local = False & Specific Version = False
In Application Files I have Publish Status =Prerequisite(Auto)
I have tried various combinations to no avail.
I looked here on the Test System on the DLL is there.
C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies
I am using the ExceptionMessageBox from SQL version 9.0.242.0 if that makes a difference and the users only have SQL 2005 Express(9.0.1399.0) installed.
So I am very confused as to why my app hangs when I try to throw an error using this....
You can't copy and deploy the assembly yourself, it has to be installed as part of the SQL client components. There are different client components for SQL 2008 and SQL 2005, your application has to reference the proper one. So you'll have to ship two different applications, one compiled for SQL 2005 and one for SQL 2008 and your users will have to install the proper one. From Deploying an Exception Message Box Application:
The exception message box is installed
by Microsoft SQL Server and is
supported for use in your custom
Windows applications to improve
exception handling. Because the
exception message box is installed by
all editions of SQL Server except SQL
Server Compact 3.5 SP1, you can use it
with no additional configuration on
any computer on which SQL Server
client components, including the SDK,
have been installed.
While technically is probably possible to deploy the assembly and add it to the GAC yourself is a bad practice as your dll will not be part of the normal chain of service packs and cummulative upgrade patches.
Also you better clear up with an MS representative whether deploying this dll standalone is OK with the SQL client usage license or not. Every component that can be redistributed under the license has an install msi available for developers to distribute. If this dll does not is a strong indicator that is not allowed to be redistributed by 3rd parties (you).
Update
There is actually a distributable msi (SQLServer2005_EMB.msi, SQLServer2005_EMB_x64.msi) for the ExceptionMessageBox component:
In SQL Server 2005 SP1 and later
releases, the exception message box is
also provided as a redistributable
installation program that you can
distribute and deploy with your
application... The redistributable
installation program for exception
message box is available online as
part of the Feature Pack for SQL
Server 2005 SP1.
do you have the assembly referenced in your MAIN application? I didn't see that scenario listed...I have found that for copy local to work, you need to have all sub-projects references in the main application reference list otherwise you get unpredictable results.
Also if you need your specific file to be used, make sure use specific version is true.
the same goes for App.config sections...if you have project level appconfigs you have to merge that with the application level app.config.

Categories