VERY NEWBIE: Connection string for web page?

Posted on 2006-03-29
Last Modified: 2010-04-16
Dear Experts,

I'm a dummy about web pages anyway, and I'm trying to do my first within Visual Studio 2005.  It's failing with:

SqlException (0x80131904): Login failed for user 'MyNormalLogin'

'MyNormalLogin' is the login I normally use to access the database in a Windows desktop application.  My guess is I need to change that to an 'IUSR_Something' login, which is already set up on the database.

What I cannot figure is how to create another ConnectionString.  I know where in the ASP to plug it in.  I just don't know how to create it.  Could anyone clue me in?

Question by:BrianMc1958
    LVL 52

    Accepted Solution

    If "MyNormalLogin" is valid on the SQL server then it should be valid full-stop, irrespective of whether you are connecting from a desktop or web app. Maybe you have typed the password incorrectly or failed to provide a password at all.

    Your connection string should look something like:

        Server=YourSQLServer;Initial Catalog=YourDatabase;UID=MyNormalLogin;PWD=YourPassword;"

    If you are using SQL logins, or else:

        Server=YourSQLServer;Initial Catalog=YourDatabase;Integrated Security=SSPI;

    If you are using Windows based login. The error message you are getting simply suggests that the password is incorrect.

    Hope this helps.

    Author Comment

    Thanks.  I can try that.  However, I still can't figure out how to MAKE another connection string.  It seems like VS treats it as it's own little object, maybe because of security issues.  I had somehow defined one yesterday, but can't figure it out again...  Could you tell me where that's done?

    Thank again,
    LVL 52

    Expert Comment

    by:Carl Tawn
    You can define your connection string in all sorts of places, so it really depends on how you are going about it.

    You may possibly have done it through the Server Explorer (which you get to via the View menu). Here you can define database connections and drag/drop them into your pages and have VS automatically create the connection objects for you.

    Author Comment

    OK.  Found it.  And you were right--I was just missing the password.


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now