Proper way to set up connection

  • What is the proper way to set up the database so that I can add a user for the connection string?  I am testing the database locally (where I connect to the server using Windows Authentication) with Visual Studio, but when the site goes live I want to be able to have a connection string that specifies the username and password.  Where/how do I set the database up for this?

  • Hi Mark,

    A couple of questions first

    What version of SQL Server are you using?

    Are you using Visual Studio.Net or another IDE?

    Is it a Web application or a desktop app?

    In General though!

    You will need to ensure that the production server is set up for mixed authentication mode. 

    You then need to add a login to the DBMS.  You will find logins under Security in SQL Server 2005

    You then need to associate those logins with permissions in your database. Stored procedures tables etc

    Finally, in your connection string you will need to add entries for Username and Password.

    The resulting string will probably look something like this

    "packet size=4096;user id=MyUserID;data source=PRODSERVER;persist security info=True;password=MyPassword"

    You must be careful how you store your connection string. Please consider using some kind of encryption to proetect the user name and password within your application

    Hope this is of some help

    regards

    Shaun

    Quis custodiet ipsos custodes.

  • Hi Shaun,

     

    I'm using Sql Server Express, but I am using it to make a Sql Server 2000 compatible db.  I am also using VS 2005 to make the web app.  Does any of this change the advice you gave me?

     

    Mark

  • Here's a handy link ... http://www.connectionstrings.com/

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Hi Mark,

    The connection string will be very much the same.  Something to look out for though is that SQL Server Express is SQL Server 2005 based rather than SQL Server 2000 based.  When you move to the SQL Server 2000 environment I think that you may have to generate scripts to recreate the database rather than copy it.  There are others here that will know more about this than I but I am happy to help if I can.

     

    Rudy's handy link suggestion is great,  I have used it myself in the past.  Do take a look.

     

    regards

     

    Shaun

    Quis custodiet ipsos custodes.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply