3 Replies - 763 Views - Last Post: 02 July 2017 - 06:28 AM Rate Topic: -----

#1 Mangore  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 187
  • Joined: 11-October 08

problem with copy and past files DB seql server to project vb.net

Posted 09 May 2017 - 05:22 AM

I creat database sql server 2008 and i tried to copy the files mdf and past them in debug folder of project VB.NET but it didn't succed
Is This A Good Question/Topic? 0
  • +

Replies To: problem with copy and past files DB seql server to project vb.net

#2 andrewsw  Icon User is online

  • the case is sol-ved
  • member icon

Reputation: 6379
  • View blog
  • Posts: 25,769
  • Joined: 12-December 12

Re: problem with copy and past files DB seql server to project vb.net

Posted 09 May 2017 - 12:41 PM

Copying and pasting won't work. To change the location of the database files you need to detach and attach as described here.

Doing this won't achieve what you want though. All it will do is change where the database lives. It won't make it deployable with your application. If you want a database that is integrated with your application then you need a service- (file-)based database such as SQL Server Compact Edition, SQLite or Firebird. If you also want to keep the data that already exists in your SQL Server database then you will need to import it.
Was This Post Helpful? 0
  • +
  • -

#3 Mangore  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 187
  • Joined: 11-October 08

Re: problem with copy and past files DB seql server to project vb.net

Posted 21 May 2017 - 10:56 PM

Thank you it succed by stop sql server
Was This Post Helpful? 0
  • +
  • -

#4 gibra  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 18-June 17

Re: problem with copy and past files DB seql server to project vb.net

Posted 02 July 2017 - 06:28 AM

you can also make backup of db, next executa a restore from new sql server. Using SSMS it's easy. I does it many time with success.
Note that the LOG file will restored on the default location of new sql server, even if the original LOG was in other disk/folder.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1