1

I want to dynamically (through code at run time) find a SQL Server instance installed on the target PC, then create a database and finally attach my MDF file.

Is it Possible? How can I do that? (I'm using C# Framework 3.5 Visual Studio 2008)

Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490
Shahrokh
  • 79
  • 1
  • 2
  • 6
  • 1
    To find all available instances on a machine, this has been asked again and again every few days lately: http://stackoverflow.com/questions/141154/how-can-i-determine-installed-sql-server-instances-and-their-versions – Davide Piras Sep 15 '11 at 13:32
  • 2
    Also, you either want to create a database or attach an existing database. You don't create a database and then attach an MDF file... – Aaron Bertrand Sep 15 '11 at 13:36

0 Answers0