11 Replies - 9680 Views - Last Post: 22 August 2013 - 07:39 AM

#1 Wrath_014   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 19-July 13

How do I create a MDF file in SQL server 2012 express?

Posted 15 August 2013 - 09:24 AM

Hello,

I'm currently in the finishing stage of my program, and I want to save the DB that the program is working with to a MDF file, which would be a personal DB for the user, instead of connecting to the server, the program will connect to that particular MDF DB and do the changes in that file.

1.How do I create it?
2.Does the MDF file acts like a MDB file for MS ACCESS?

Thanks for your help.

This post has been edited by Wrath_014: 15 August 2013 - 09:24 AM

Is This A Good Question/Topic? 0
  • +

Replies To: How do I create a MDF file in SQL server 2012 express?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15481
  • View blog
  • Posts: 62,021
  • Joined: 12-June 08

Re: How do I create a MDF file in SQL server 2012 express?

Posted 15 August 2013 - 09:28 AM

You would add it to the program's projects... I am guessing this program is written with VS Express?


Quote

1.How do I create it?

Right click on your project -> add -> new -> common items -> data -> service-based db.

Quote

2.Does the MDF file acts like a MDB file for MS ACCESS?

In what sense?
Was This Post Helpful? 0
  • +
  • -

#3 Wrath_014   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 19-July 13

Re: How do I create a MDF file in SQL server 2012 express?

Posted 15 August 2013 - 11:55 PM

View Postmodi123_1, on 15 August 2013 - 09:28 AM, said:

You would add it to the program's projects... I am guessing this program is written with VS Express?


Yes. VB.net

Quote

Right click on your project -> add -> new -> common items -> data -> service-based db.


I don't see it. I want a single Database, Workhours, to be the MDF file.
Sorry for being a newbie, but I can't find it..

Posted Image

Quote

In what sense?

In a sense that I place this DB next to my application, And the application will connect it instead of the server. A local DB.

This post has been edited by Wrath_014: 15 August 2013 - 11:55 PM

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15481
  • View blog
  • Posts: 62,021
  • Joined: 12-June 08

Re: How do I create a MDF file in SQL server 2012 express?

Posted 16 August 2013 - 06:44 AM

Again - you would want to do this in your VB.NET app's project - not the Database Management Tool. You would then need to recreate all these tables in the MDF.
Was This Post Helpful? 1
  • +
  • -

#5 Wrath_014   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 19-July 13

Re: How do I create a MDF file in SQL server 2012 express?

Posted 16 August 2013 - 09:09 AM

View Postmodi123_1, on 16 August 2013 - 06:44 AM, said:

Again - you would want to do this in your VB.NET app's project - not the Database Management Tool. You would then need to recreate all these tables in the MDF.

Thank you, I got it.

Can't I do the same with the current DB I have in MS SQL Server Express 2012?
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15481
  • View blog
  • Posts: 62,021
  • Joined: 12-June 08

Re: How do I create a MDF file in SQL server 2012 express?

Posted 16 August 2013 - 09:17 AM

Quote

Can't I do the same with the current DB I have in MS SQL Server Express 2012?

What?
Was This Post Helpful? 0
  • +
  • -

#7 Wrath_014   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 19-July 13

Re: How do I create a MDF file in SQL server 2012 express?

Posted 17 August 2013 - 08:31 AM

View Postmodi123_1, on 16 August 2013 - 09:17 AM, said:

What?


Save it, as a local DB. Instead of recreating it again.


Like the MDB file for MS Access. You could simply put the MDB next to the app, and connect to the MDB and make all the changes. Thats what I mean.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15481
  • View blog
  • Posts: 62,021
  • Joined: 12-June 08

Re: How do I create a MDF file in SQL server 2012 express?

Posted 17 August 2013 - 09:45 AM

Ah, no. SQL server is a wee bit more complex. You can script out your table creates but that's about it.
Was This Post Helpful? 1
  • +
  • -

#9 Wrath_014   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 19-July 13

Re: How do I create a MDF file in SQL server 2012 express?

Posted 18 August 2013 - 07:20 AM

View Postmodi123_1, on 17 August 2013 - 09:45 AM, said:

Ah, no. SQL server is a wee bit more complex. You can script out your table creates but that's about it.

Thanks.
Was This Post Helpful? 0
  • +
  • -

#10 Wrath_014   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 19-July 13

Re: How do I create a MDF file in SQL server 2012 express?

Posted 18 August 2013 - 11:52 AM

Sorry for the DP, but I encountered a weird problem concerning the MDF.

I've recreated my tables and on the first run everything seemed to be working fine, untill I ran again the progrem, and then I found out that the data has not been saved on the MDF. I've tried twich doing it, and when I ran the program again, same results where the data isn't saved.

Why the data isn't saved when I terminate the debug?

PS. When I use the SQL Server there are no problems...

Thanks in advance.
Was This Post Helpful? 0
  • +
  • -

#11 Wrath_014   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 19-July 13

Re: How do I create a MDF file in SQL server 2012 express?

Posted 22 August 2013 - 07:20 AM

Anyone? Please..
Was This Post Helpful? 0
  • +
  • -

#12 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15481
  • View blog
  • Posts: 62,021
  • Joined: 12-June 08

Re: How do I create a MDF file in SQL server 2012 express?

Posted 22 August 2013 - 07:39 AM

Without knowing/seeing how you are saving/updating data it's hard to say.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1