Is it possible to view .mdf(Mssql server database file) files in c#?

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 1515 Views - Last Post: 30 March 2013 - 06:45 AM Rate Topic: -----

#1 mikelsey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-March 13

Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 27 March 2013 - 10:27 AM

I want to know if it is possible to view tables of .mdf database files without using sql server in c#?
Is This A Good Question/Topic? 0
  • +

Replies To: Is it possible to view .mdf(Mssql server database file) files in c#?

#2 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 312
  • View blog
  • Posts: 486
  • Joined: 13-June 12

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 27 March 2013 - 11:07 AM

Afraid not. You need SQL Server's engine to connect to the file.
Was This Post Helpful? 0
  • +
  • -

#3 Michael26  Icon User is online

  • Radar love
  • member icon

Reputation: 332
  • View blog
  • Posts: 1,419
  • Joined: 08-April 09

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 27 March 2013 - 12:55 PM

Isn't sql express offered as option in installation of visual studio?
Was This Post Helpful? 0
  • +
  • -

#4 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1174
  • View blog
  • Posts: 1,659
  • Joined: 24-August 11

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 05:49 AM

I feel like it is. Honestly, I don't remember ever explicitly saying I wanted SQL Express installed with VS, so I think it's just packaged in (I really only have experience with Pro and Ultimate versions though, so maybe it's an option on other versions).

So OP, if you just add the container to your project, you can simply double-click it and it should pop up in Server Explorer and you can browse the table structure and make changes.
Was This Post Helpful? 0
  • +
  • -

#5 pharylon  Icon User is offline

  • D.I.C Head

Reputation: 40
  • View blog
  • Posts: 83
  • Joined: 01-September 12

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 06:01 AM

I have VS Express, and SQL Express is included, so it must be in all versions.
Was This Post Helpful? 0
  • +
  • -

#6 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4309
  • View blog
  • Posts: 7,457
  • Joined: 08-June 10

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 06:03 AM

Sql Express is a freebie, and I believe it comes with any version of VS that includes ASP.NET (that would be Express for Web and every paid version).

However, you have to consider that if you're making a client application (like a windows forms or WPF app) that is going to be deployed on other people's desktops, SQL Express on your desktop doesn't help you much, because you're not going to want those clients connecting to you.

You either need to install SQL Express on a server you want others connecting to, or use something like SQL CE or Sqlite.
Was This Post Helpful? 0
  • +
  • -

#7 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 312
  • View blog
  • Posts: 486
  • Joined: 13-June 12

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 06:22 AM

Exactly. OP was not asking if there was a free way to access the file, only if he could do it without SQL Server (Express or otherwise) so presume there's a use case for this.
Was This Post Helpful? 0
  • +
  • -

#8 mikelsey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-March 13

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:03 AM

Thanks for your response firstly.i want to just view rows of any table in .mdf files on my computer i don't want to change anything or to write application to many client just for single computer and program shows content of mdf files.all this things must be made without sql server.nosql can be solution?
Was This Post Helpful? 0
  • +
  • -

#9 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4309
  • View blog
  • Posts: 7,457
  • Joined: 08-June 10

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:19 AM

Why do you have a requirement not to use Sql Server? Sql Express is free.
Was This Post Helpful? 0
  • +
  • -

#10 mikelsey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-March 13

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:22 AM

Because i don't want to install sql server to my computer.i use mdf files just for viewing contents
Was This Post Helpful? 0
  • +
  • -

#11 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4309
  • View blog
  • Posts: 7,457
  • Joined: 08-June 10

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:24 AM

Well, then you're out of luck. MS SQL databases are a proprietary format that's designed to be read by SQL Server. If you don't want to install it, you don't get to view the contents of your database file.
Was This Post Helpful? 0
  • +
  • -

#12 mikelsey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-March 13

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:28 AM

I found this but not free i have no idea how it works
Was This Post Helpful? 0
  • +
  • -

#13 mikelsey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-March 13

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:34 AM

www.systoolsgroup.com/sql-recovery.html
Was This Post Helpful? 0
  • +
  • -

#14 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4309
  • View blog
  • Posts: 7,457
  • Joined: 08-June 10

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:37 AM

I'm starting to think you're doing something shady. You don't want to use official free software to read these files. There's got to be a reason beyond "I don't want to" that you'd make your life harder.
Was This Post Helpful? 0
  • +
  • -

#15 mikelsey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-March 13

Re: Is it possible to view .mdf(Mssql server database file) files in c#?

Posted 28 March 2013 - 07:40 AM

I am not doing something like your thinking i am student and i search if there is solution.if there is i want to make it thanks for your advice
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2