• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Set up a local SQL Server DB on my dev box

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Set up a local SQL Server DB on my dev box

    I'm developing in C# in Visual Studio 2013, and I want to create a simple SQLServer DB mirroring one the software will talk to - a few tables and a handful of dummy stored procs.

    I've done a fair bit of C# and SQL but I don't know SQLServer and the built-in Visual Studio tools, so it's unclear to me how I can most easily get these stored procs running on my dev-box so I can run my code locally. I can install SQLServer Express but do I actually need to run a full DB environment, or does Visual Studio provide some neat way of running up a trivial DB for me when my application starts up? Running SQLServer seems a bit heavyweight when I want little more than 5 stored-procs that return hard-coded values!

    Visual Studio's DB connection, datasources, SQL server database project type, are confusing me as to what the easy/good way to do this is... and it's too broad a question to ask on StackOverflow. Can anyone advise me?
    Last edited by d000hg; 19 April 2016, 14:20.
    Originally posted by MaryPoppins
    I'd still not breastfeed a nazi
    Originally posted by vetran
    Urine is quite nourishing

    #2
    Originally posted by d000hg View Post
    I'm developing in C# in Visual Studio 2013, and I want to create a simple SQLServer DB mirroring one the software will talk to - a few tables and a handful of dummy stored procs.

    I've done a fair bit of C# and SQL but I don't know SQLServer and the built-in Visual Studio tools, so it's unclear to me how I can most easily get these stored procs running on my dev-box so I can run my code locally. I can install SQLServer Express but do I actually need to run a full DB environment, or does Visual Studio provide some neat way of running up a trivial DB for me when my application starts up? Running SQLServer seems a bit heavyweight when I want little more than 5 stored-procs that return hard-coded values!

    Visual Studio's DB connection, datasources, SQL server database project type, are confusing me as to what the easy/good way to do this is... and it's too broad a question to ask on StackOverflow. Can anyone advise me?
    Use LocalDB it is just a file but mimics SQL Server you can access it through VS interface.

    /thread

    Comment


      #3
      I've come across LocalDB - seen examples of connection strings and MDF files - but not understood how it fits into VS i.e. how do I actually create a LocalDB DB, do I need any other software installed beyond VS, etc.

      Got a link to a tutorial or even a good Google search term? Once I get started I'll be fine but I don't know exactly what the question is I want to ask!
      Originally posted by MaryPoppins
      I'd still not breastfeed a nazi
      Originally posted by vetran
      Urine is quite nourishing

      Comment


        #4
        Originally posted by d000hg View Post
        I've come across LocalDB - seen examples of connection strings and MDF files - but not understood how it fits into VS i.e. how do I actually create a LocalDB DB, do I need any other software installed beyond VS, etc.

        Got a link to a tutorial or even a good Google search term? Once I get started I'll be fine but I don't know exactly what the question is I want to ask!
        It should come with visual studio and should already be installed. Try connecting via Server Explorer

        Comment


          #5
          AFAIAA, SQL Express won't do DB Mirroring, you'll need Developer Edition for that (if I understand correctly that's what you want to do).

          And one month after I purchased SQL 2014 developer, M$ announces it is now free.

          qh
          He had a negative bluety on a quackhandle and was quadraspazzed on a lifeglug.

          I look forward to your all knowing and likely sarcastic and unhelpful reply.

          Comment


            #6
            Originally posted by quackhandle View Post
            AFAIAA, SQL Express won't do DB Mirroring, you'll need Developer Edition for that (if I understand correctly that's what you want to do).

            And one month after I purchased SQL 2014 developer, M$ announces it is now free.

            qh
            Inasmuch as I understand what you mean, I don't think my needs require anything so fancy. This is purely so I can run my C# code on my dev box and the stored proc/table it wants to interact exists. It's not even a test DB, just a local throwaway one that can/should be destroyed/created when I launch VS for all I care. Almost the same principle as SQLLite but it needs to be actual SQLServer.
            Originally posted by MaryPoppins
            I'd still not breastfeed a nazi
            Originally posted by vetran
            Urine is quite nourishing

            Comment


              #7
              Originally posted by d000hg View Post
              Inasmuch as I understand what you mean, I don't think my needs require anything so fancy. This is purely so I can run my C# code on my dev box and the stored proc/table it wants to interact exists. It's not even a test DB, just a local throwaway one that can/should be destroyed/created when I launch VS for all I care. Almost the same principle as SQLLite but it needs to be actual SQLServer.
              So why won't the express version do what you need?
              Knock first as I might be balancing my chakras.

              Comment


                #8
                Originally posted by quackhandle View Post
                And one month after I purchased SQL 2014 developer, M$ announces it is now free.

                qh
                oh ta for that!
                Always forgive your enemies; nothing annoys them so much.

                Comment


                  #9
                  Originally posted by suityou01 View Post
                  So why won't the express version do what you need?
                  I don't think I even need the Express edition, that's rather the point - I want to use LocalDB which is part of VS.

                  I've set up a SQL Server VS project and upon publishing it runs up a DB instance but seemingly against SQLServer (which I apparently installed in the past) not LocalDB. I see localhost and LocalDB listed as DB servers but I can't seem to tell VS to deploy my DB project to LocalDB.

                  Since it's working (I think) on my box I might not care so much, it's just a little non-obvious how you're supposed to do this.
                  Originally posted by MaryPoppins
                  I'd still not breastfeed a nazi
                  Originally posted by vetran
                  Urine is quite nourishing

                  Comment

                  Working...
                  X