Create a LocalDb Named Pipe

I was unable to find this information easily, had to play around with some things myself to find it. I’m hoping by posting here, others will be able to find it easier than I did.

If you want to create a named pipe for localdb, you can use the sqllocaldb.exe tool in command prompt.

If you want to create a new localDb, do the command:
sqllocaldb create "Local Database Name Here"
After that, you will need to start the localdb by doing:
sqllocaldb start "Local Database Name Here"
Once you’ve started it, you can use info provided by the info command to get the named pipe uri.
sqllocaldb info "Local Database Name Here"
That’s all there is to it. I’ll add more info later to see about creating and fetching the info via code.


Looked into doing this via code and I was going to provide a p/invoked class to use but I found one already made that works really well.

You can find the NuGet package by typing the following into the Package Manager Window in Visual Studio:

Install-Package System.Data.SqlLocalDb

Or by downloading from the website here:

Usage is pretty simple:

Your info object now contains a bunch of information about your LocalDatabase. The named pipe is under the info.NamedPipe attribute. That’s all you need to do for accessing your LocalDb info in C# code! Comment below if you have any questions or want to contribute anything!

Comments (5)

  • dab

    February 22, 2015 at 1:58 pm

    I am so grateful for your article post.Much thanks again. Awesome.

    Reply Edit
    • dab

      January 5, 2017 at 1:28 am

      Hello there! This post could not be written any better! Reading through this post reminds me of my old room mate! He always kept chantitg about this. I will forward this write-up to him. Fairly certain he will have a good read. Thank you for sharing!

      Reply Edit
  • dab

    May 7, 2015 at 6:06 pm

    This (my) library has been moved to GitHub now:

    Reply Edit
    • dab

      July 14, 2015 at 12:15 am

      Thanks for the notification. I’ll update the link in my post 🙂

      Reply Edit
  • dab

    April 9, 2017 at 4:16 am


    Reply Edit

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>