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
3
votes
1 answer

C# MDF database is not inserting data even if success message is displayed

I need to insert data when user clicks. But, my code isn't doing it. Even though it displays the data inserted message, the data is not inserted. How can I find the mistake? private void bunifuFlatButton2_Click(object sender, EventArgs e) { …
user7883991
3
votes
1 answer

How do you setup a database and connect to it using Razor web pages in Visual Studio?

I've looked and looked but could not come up with a working solution. As an intermediate with C# and decent with HTML and things, I thought I'd fool around with Razor Web Pages and make a simple website. I was hoping to create a database with a list…
Stephen
  • 576
  • 8
  • 19
3
votes
3 answers

c# Connecting to a local MDF DB File

On my development computer I have MS SQL Server/Visual Studio 2005. My program can correctly connect to my local DB and use it. However my other computer (non-dev) does not have MS SQL Server/Visual Studio 2005 and does not connect to the DB. It…
Exegesis
  • 1,028
  • 1
  • 18
  • 47
3
votes
1 answer

how to use .mdf while developing

I use a .mdf database for my asp.net Mvc project. The project is on source control on a tfs. When I debug the project, Visual Studio copies the database in to the debugmap. The problem is, when I debug next time, the changes (while testing the…
Masna
  • 213
  • 1
  • 3
  • 12
3
votes
2 answers

how does one programmatically create a localdb .mdf?

how does one programmatically create a localdb .mdf? acceptable solutions exclude visual studio, ssms, aspnet_regsql. a naive stab at a solution might look like this: static void Main(string[] args) { using (var con = new…
Spongman
  • 9,665
  • 8
  • 39
  • 58
3
votes
4 answers

How to query from log files (.ldf) of Sql Server 2005 Express edition?

I want to do this, because I would like to know how many times a particular row has been changed. Is this possible? Thanks
Jey Geethan
  • 2,235
  • 5
  • 33
  • 60
3
votes
2 answers

MDF (SQL) database file is over 88 GB and i have no idea why!

With some reason my sql database file exploded to become over 88 GB and i can't see a reason why. i run few scripts to search for large tables, found nothing to be too big. i also tried to run shrink database (which did nothing) and shrink files…
Or A
  • 1,789
  • 5
  • 29
  • 55
3
votes
1 answer

Backup and Restore database MDF C# WinForm didnt work

Im trying to Backup and Restore my database .MDF file in C# WinForms. I think it backup because I saw a .BAK file but when I restore, its not working. Both have no error on runtime but I think theres something wrong with my code. Here's my code: …
ViFer
  • 283
  • 1
  • 6
  • 23
3
votes
6 answers

ExecuteNonQuery() not saving any record

I'm working a WinForms based C# tool which has an attached MDF file based database. I'm trying to use the SqlCommand.ExecuteNonQuery() method to save a record to this attached MDF database, but the record is not saved. No error or exception occurs;…
Ahmad
  • 12,886
  • 30
  • 93
  • 146
3
votes
1 answer

Python open Microsoft SQL Server MDF file

How can I open an Microsoft SQL Server MDF file in Python? Edit I've tried pyodbc.connect but that requires a legitimate "server connection"—you can't simply open the MDF file— pyodbc.connect(driver='{SQL Server}', dbq=r'c:\database.mdf') (Like…
user1458476
  • 143
  • 2
  • 8
2
votes
2 answers

Does user need SQL 2008 Express Installed if I deploy app with .mdf file?

I'm making a Win app on the 3.5 framework. I'd like to include a database file with the app. This would a single-user db. I looked at the 2 different types of db files I can add, the sdf and mdf. Thw sdf (compact) db is missing some functionality…
josha76
  • 131
  • 1
  • 12
2
votes
4 answers

Quickest way to restore a record from a SQL Server 2008 MDF file

I was wondering what the best approach would be to restoring a single record from an MDF file (generated as backup on the live instance) into the live SQL Server database. I know about the process of attaching the file to the database and have read…
2
votes
0 answers

Check if a File is written or in use by another process

I try to find a solution for the following problems but can't find any good solution. I have a folder with subfolder and files in it. Some of the files may be in use by another process (the other process is writing data to the data (a .mdf file)). I…
Hamholder
  • 21
  • 4
2
votes
2 answers

How to host the core project with IIS using mdf file

I have tried to host the core project with mdf file in the IIS server. The below webconfig file works fine in the localhost. But when I publish it to IIS, I got a 500-internal server error. This is the webconfig:
Bhuvana
  • 21
  • 2
2
votes
1 answer

Connecting to the Database on client side

I am working on a standalone desktop application. I am Using an mdf file for the database and I have two connection strings Server =.\SQLExpress; AttachDbFilename = C:\MyFolder\MyDataFile.mdf; Database = dbname; Trusted_Connection = Yes; I don't…