Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


VERY NEWBIE: Connection string for web page?

Posted on 2006-03-29
Medium Priority
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
  • 2
  • 2
LVL 52

Accepted Solution

Carl Tawn earned 500 total points
ID: 16321753
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

ID: 16321828
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
ID: 16321856
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

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


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

580 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