Home > Net >  The database file connection problem
The database file connection problem

Time:09-23

Everyone a great god, and these days I met such a problem, don't know how to solve, baidu also could not find the reason why,

My computer at home has built a database that has built a project on the mobile hard disk, and then separate the database to the project, the day in the home run, data, is very normal,
Connect to the database file code is as follows:
 & lt; The add key="ConnStr" value="Source=https://bbs.csdn.net/topics/Data./SQLEXPRESS; AttachDbFilename=H://website construction site construction practice/NewsWeb/NewsWeb/DB/NewsWeb. MDF. Integrated Security=True; The Connect Timeout=30; The User Instance=True "/& gt; 


The next day, the company can run more, then connect the database code to the following:
 & lt; The add key="ConnStr" value="Source=https://bbs.csdn.net/topics/Data./SQLEXPRESS; AttachDbFilename=| DataDirectory |/NewsWeb. MDF; Integrated Security=True; The Connect Timeout=30; The User Instance=false "/& gt; 

Change after, in the company operating normally,

Night came home, my home computer and operation is not normal, suggests the following error:


Then I have been looking for solutions, fruitless,

After back to the company, the company computer to run also cannot run,

Then, in the company, I built the database again, projects can be normal use, in addition to build the new database table, not fill in any data, display of data before or after running data,

I don't know what is the problem, because of my project on the mobile hard disk or what,


Attach the company and home database version
of


at home

CodePudding user response:

Figure 2 a path for a chose not to go? As long as you can connect to the database, can continue to write programs to go,

CodePudding user response:

Look from the map, you use two Sql Server Management Studio version, but
Management Studio is the client, not the actual Sql services,

To check and confirm the Sql server version, can be in Management under the Studio query:
 SELECT @ @ VERSION 

CodePudding user response:

Computers have two versions of the used

CodePudding user response:

The database version is higher than company at home?
  •  Tags:  
  • C #
  • Related