Questions tagged [mdf]

Master Database File (.MDF) is the starting point of a SQL Server database. It is the primary data file and also points to the other files in the database.

See the Wikipedia article on Microsoft SQL Server.

Related Tags:

429 questions
0
votes
2 answers

Data lost from .mdf file as I exit application

Recently I work on SQL Server 2008 R2 database. I create database and attach .mdf file of same database in my application with some default data in it . Run application default data coming properly. Now I insert, update some data in my application…
Ankush Madankar
  • 3,689
  • 4
  • 40
  • 74
0
votes
1 answer

How can I generate the SQL CREATE TABLE statement for an MDF table?

I have an .mdf file with Visual Studio 2008 with one table in it that has numerous columns of various types. How can I generate the SQL statement that produces this table so that I can alter it and create another similar table? Is there a way to do…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
0
votes
1 answer

Microsoft SQL Server Database File (SqlClient) Portable String

i have build my program with C# and the problem is that i use "Microsoft SQL Server Database File (SqlClient)" for my db and i wanted to make it portable because if i take all the project(sln) and give it to my friend to run it the database path is…
dbexec
  • 274
  • 9
  • 19
0
votes
1 answer

How can I change the login info for a .mdf sql server file that had windows authentication set, if the computer no longer exists?

At our company, we had a computer running Outlook 2007 Business Contact Manager, with all our info tied to the SQL Server database MSSmallBusiness.mdf file. Everything was fine and dandy. We decided to update the computer to Windows 7, so we…
kyle
  • 35
  • 1
  • 4
0
votes
1 answer

Database install approach - attach MDF or restore BAK

I have some pre-built databases that go with a base software release. Previously we have released the MDFs and a little tool to copy/attach them, and just letting SQL Server rebuild the log file. Is releasing the backup BAK files and modifying the…
statikuz
  • 797
  • 7
  • 11
0
votes
2 answers

What is the best deployment approach for WPF applications with local database?

I want to make a WPF application that exists in one directory including all files that it needs: .exe, .mdf database, .xml config files, etc. the application should work no matter what directory it is in so that it supports this scenario: person…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
0
votes
1 answer

C# mdf database doesn't update on program startup

I create simple example to create question easyer. So in my c# project I create an mdf database with articles. Then I connect database in my program and read values from table articles. It gives me results, but not the latest. If I have one result…
Clem
  • 11,334
  • 8
  • 34
  • 48
0
votes
0 answers

OLEDB connection to mdf file

I am working on a development project that needs to connect to a sql database. The thing is,is that the database will be stored only on the local machine. I also only have access SQL Server express, and I cannot use a .sdf database because the limit…
TigerCoder
  • 93
  • 10
0
votes
1 answer

Selecting LDF file using sys.master_files

This might be simple but can not find example of selecting LDF file form sys.master_files. I have got the MDF file using cmd.CommandText = ("select physical_name from sys.master_files where database_id = DB_ID('" + "mydatabasename" + "')");
Jed I
  • 998
  • 3
  • 19
  • 37
0
votes
1 answer

SQL Management Studio Exporting Data

I currently have a mdf database on management studio and I would like to export the data to a sql file. Exporting the data with the data-source: SQL Server Native Client works fine, but i have no idea where he saved the exported data. Any help?
Jamie
  • 93
  • 2
  • 13
0
votes
2 answers

Where should the database be for this code?

I have the following web.config file that contain the code as follows:
Jack
  • 1,603
  • 5
  • 25
  • 36
0
votes
1 answer

Is it possible to use a SQL Server backup and link it to Visual Studio 2012 or you need the .mdf file?

I have a SQL Server backup from my server and I have a comfortable way to access the daily SQL Server backups. I want to do some asp.net coding using Visual Studio 2012, and I do not want to install SQL Server on my machine since it is too heavy and…
mdm
  • 43
  • 4
0
votes
1 answer

Cannot add database to an Asp.Net application

I'm unable to add an mdf database file by right clicking on the project name and clicking on "Add->New Item->SQL Server Database". It gives me the following error... ** Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to…
Josh
  • 13,530
  • 29
  • 114
  • 159
0
votes
2 answers

Attach a .MDF file created by SQL Server 2008 in SQL Server 2000

I created a database in SQL Server 2008. I detached the database and I copied the .mdf over to the server, which is running SQL Server Enterprise Manager (SQL Server 2000). When I try to attach the MDF I get... Microsoft SQL-DMO (ODBC SQL State:…
younes faqri
  • 3
  • 1
  • 3
0
votes
1 answer

Cannot open database ASPNETDB.MDF

I used default Membership of ASP.NET. After formatting PC and installing SQL Server Managment Studio I run application, I can not access my ASPNETDB.MDF, but can access other DB. For example, when I try to register get so error: Connection string…