I have installed a .net Windows application on a client's machine and its database is in SQL Server 2000.
For the application, I installed the .net framework and other support software and for database I installed SQL Server 2000 and created a database over there and connect it. Working properly
But now client changed from Windows XP to Windows 7. I search for installation of SQL Server 2000, but it's not working over there. So what I did, I sent the .mdf file of the database with exe application and make connection string
<add name="AccountingConnectionString"
connectionString="data source=.\SQLEXPRESS Integrated Security=SSPI;AttachDBFilename=C:\SetupOfApplication\DataBase\Database.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
and it's also working.
Now i change something in database, and trying to update the .mdf file but its not reflecting the new one .mdf is getting the old one. I am stuck......
Did I do something wrong? Because its difficult for me to fix.
OR
I want to know what is the efficient way of use of SQL Server 2000 database on Windows 7 or any else solution is there?
Related
hi please if you can help me with this problem
I have a application with database in C# and only run on the computers where I have installed Visual Studio on the other computers the app run but not find the database. The database is Microsoft SQL Server Database File (SqlClient)
in app.config i have this settings
<connectionStrings>
add name ="db" connectionString="Data Source= > >(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\util\service.mdf;Integrated Security=True;Connect Timeout=30"/>
</connectionStrings>
the path of the database in the other computer is correct set
You cannot use the .mdf file without a SQL Server engine. It works on your Visual Studio machines, because it comes with SQL Server Express.
LocalDB cannot be accessed remotely, as stated here
If you are going to use the same database, you probably should setup SQL Server Express on your server then update the connection string on the other machines, otherwise you will need to install LocalDB on each machine.
You don't need to install visual studio on all the machines, when you build your application (in debug or release mode) you only need to copy the files in the related bin folder to the target machine. (if I understood that bit)
The config files contains the connection string to the database, in your case a local file (but will be using SQL Express) Look at creating your database in SQL Server Express and pointing to that in development. On the target machines you can then install SQL Express and use that. The connection string will be different to what you have now, look for some examples..
My development PC has SQL Server 2008. I have a database which is created and running on SQL Server 2008. Instance name of SQL Server 2008 is SQLEXPRESS that is default one. My connection string is something like:
<add name="DB1Entities"
connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\DB1.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
Working nicely on my development PC. But as I tried to run on another PC it's not working, but instead showing this error :
System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: The database '..\DB1.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.
First my test PC has only SQL Server 2005 (instance name: SQLEXPRESS). Due to this error I have installed SQL Server 2008 (instance Name: MSSQLSERVER). I have tried many solutions from internet. I have also tried by changing instance mame in connection string. But still same error is there. I think I may need to swipe instance name of SQL Server 2005 and 2008. But don't know how to do that.
Any solution please?
According to your error message and this chart you have an MDF file that is version 655 (SqlServer 2008) and you are trying to use it in a machine where is installed Sql Server 2005 that supports till version 612.
Now the bad news. You cannot use that file version in that system. There is no tool that can do a "conversion" of the two files and Sql Server is notoriusly know to not support this scenario
Your options are limited. You can upgrade your destination system to the latest version of Sql Server Express and try to load your file in that renewed system. Usually there is no problem when a newest version of Sql Server tries to read a previous version (not before Sql Server 2005 though).
Another possibility is to script your current Sql Server database and then run the script on the destination machine
I have two .NET applications, one running on 2.0 and the other running on 4.5.
The .NET 2.0 application is the main application where the user inputs data and this runs perfectly. The .NET 4.5 application is a Telerik Reporting site that runs a report based on data entered in the 2.0 application and is receiving the error below
system error 32 (the process cannot access the file because it is being used by another person)
Both applications are using this the connection strings below.
<add name="sqlserver"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=c:\FolderName\Database.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient"/>
I set up SQL Server Express to use windows authentication but I can't seem to get it to work. Any help would be greatly appreciated.
You can't. SQL Server process holds a lock on the file while it's up and running.
But alternatively, you can setup a database server and point both apps to the same database.
Or have two instances with replication.
Database files are good for development, but not to be used in production environments.
When running an ASP.NET MVC 3 app (written in VS 2010, tested and working using SQL Server Express 2012, .NET 4.0, Windows 7 Pro) on an Amazon Web Services host (Windows Server 2008, ASP.NET 4.0 app pool, SQL Server Express 2008, IIS7), I am unable to connect to the local database on that machine, nor see any errors in connecting. I am using the following ConnectionString in Web.config:
name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=aspnet-NewWebSite-20141030101548;Integrated Security=SSPI" providerName="System.Data.SqlClient"
Is there a modification I should make to this to make it work? I can't upgrade to SQL Server 2012 on this AWS instance. I can't even log to the Event Viewer or email errors to myself. I'm stumped.
Your connection string is pointing to a local db instance, and AWS probably doesn't support LocalDB. What you want to do is to get a DB instance that supports remote connection ( you can get one from AWS directly) and find out the connection string of that server, change yours accordingly.
I created a software using .net4 which uses ORM and connects to database. So when I need to connect to a file I have to first open SQL Server Management Studio and attach the database to it and then I am able to use my software if I don't do this it throws an exception that the underlying provider failed to open.
Now I want to deploy the software to my brothers computer who doesn't have Visual Basic and SQL Server installed on his computer (but he has the .net framework) so is there a way I can modify my app.config to point to the database file instead and I don't need to attach the file to the SQL Server?
Simply I don't want to attach or detach the file to the database again and again how can the .net automatically attach it.
Indeed, install the SQL Server 2012 Express LocalDB (it is likely already installed with your Visual Studio 2012 installation) and then modify the connection string as follows:
connectionstring="data source=(LocalDB)\v11.0;attachdbfilename=c:\MyDatabaseFile.mdf;integrated security=True;"
the (LocalDB)\v11.0 part is where you point at the LocalDB "instance", and you can attach any mdf file you want. Keep in mind that this locks up the mdf file, so you cannot have it open in Management Studio and run your app.
You mentioned attaching a database, but not wanting to install SQL Server. I would take a look at the SQL Server Express LocalDB. While it is technically installed, it is not installed as a Windows Service, so it is much lighter than full SQL server or SQL Express.