468,720 Members | 1,675 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,720 developers. It's quick & easy.

.mdf DataBase in c# program

Hello all,
I have a db file .mdf in my program. I wander if it saves it everytime
values are inserted and if not how can it be done ? furthermore i want
to know where can i see the .mdf file after the program closes and
with what program.
cheers,
amir.

Mar 11 '07 #1
1 3777
Hello amir,
>I have a db file .mdf in my program. I wander if it saves it everytime
values are inserted and if not how can it be done ? furthermore i want
to know where can i see the .mdf file after the program closes and
with what program.
As you can see on Wikipedia (http://en.wikipedia.org/wiki/.mdf), the
extension .mdf can stand for a variety of things, but it seems a good
assumption that we're talking about a database file of Microsoft's SQL
Server here. If that is true, the answers to your question would be
something like this:
>I wander if it saves it everytime values are inserted and if not how can
it be done ?
Yes, it should save automatically every time values are inserted -
provided you do this correctly. For instance, you have to make sure you
actually push the values back from the Dataset you may be using, and that
any transactions are committed correctly and so on... I suggest you read
up on using ADO.NET if you find you're having problems in this area.
>furthermore i want to know where can i see the .mdf file after the program
closes and with what program.
Well, Explorer comes to mind - in a standard installation you might find
the files in a location like C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data.

Now, I expect this wasn't really the question you wanted to ask, as you're
also interested in the content of the file. To view that, you'll have to
use a tool that can talk to SQL Server (much like your own application
does), which will in turn access the file. Generally speaking there are
loads of tools out there that you could use, but there are some that
either come with SQL Server, or are freely available:

* For SQL Server 2005, you should be able to find the SQL Server Management Studio in your Start menu. I guess it's possible to install SQL Server without this tool, but in that case you should be able to install the tool from your original installation media.

* For SQL Server 2005 Express Edition, Microsoft makes the SQL Server Management Studio Express available for download here: http://www.microsoft.com/downloads/d...8-5A0F62BF7796

* For older versions of SQL Server, there were a number of tools - you should start looking at Enterprise Manager, which should be in your Start menu if you haven't chosen not to install it.

Hope this helps.
Oliver Sturm
--
http://www.sturmnet.org/blog
Mar 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Rob Young | last post: by
7 posts views Thread by News | last post: by
7 posts views Thread by ianenis.tiryaki | last post: by
15 posts views Thread by chaseexchange | last post: by
8 posts views Thread by situ | last post: by
1 post views Thread by CARIGAR | last post: by
9 posts views Thread by bryonone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.