title: How to create local database Instance using SMO
body: <p>I have installed localdatabase and created a shared instance, and using smo I am able to create localdatabase.</p>
  
  <p>For my requirement I have to create a localdb shared instance.</p>
  
  <p>I am creating local database using SMO like this.</p>
  
  <pre><code>ServerConnection serConn = new ServerConnection(@"(localdb)\.\sharedIns");
  Server ldbServer = new Server(serConn);
  
  Database db = new Database(ldbServer , "databaseName");
  db.Create();
  </code></pre>
  
  <p>Before creating database, I am creating shared instance through command prompt using sqllocaldb.exe like this</p>
  
  <pre><code>c:\&gt;sqllocaldb create testIns
  c:\&gt;sqllocaldb share testIn sharedIns
  </code></pre>
  
  <p>I want to remove these manual steps and create localdb shared instance using SMO. How to do this?</p>