Re: What's My Password?
- From: "Miha Markic [MVP C#]" <miha at rthand com>
- Date: Mon, 8 Jan 2007 09:58:33 +0100
Hi Jonatahan,
Well, it depends on some factors.
1. Do you wanna use integrated security (credentials that process is running under). More secure and recommened as you don't have to store password anywhere.
2. Do you want to use sql authentication. Less secure as you have to provide username and password.
3. If 2 then you have to make sure your sql express is configured to allow sql authentication.
4. If 1 then you have to give sql server privileges to the account under which your asp.net application is running.
Here is a good article on the topic
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch05.asp
Also be aware that default asp.net processes on 2003 uses different credentials than the one on xp.
HTH
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message news:OtPeTqtMHHA.1252@xxxxxxxxxxxxxxxxxxxxxxx
Grrr...
I've spent the last several hours trying to learn ADO.NET. Specifically, the database connection stuff.
I finally managed to create a database and enter some data within the VS IDE. I have several ADO.NET books but not one could tell me how to set up my password.
To make a long story short, I ended up setting up a connection using (local)\SQLEXPRESS since that's what the only example I could find uses and I have no idea what to enter for regular MS SQL.
But I didn't have a change to enter a password or anything like that. Based on another book, I tried all of the following:
string connString = "Data Source=localhost;Initial Catalog=BlackBeltCoder;Integrated Security=True";
string connString = "Data Source=localhost;Initial Catalog=BlackBeltCoder;Integrated Security=SSPI";
string connString = "Data Source=localhost;Initial Catalog=BlackBeltCoder;user id=sa;password=opensesame";
SqlConnection conn = new SqlConnection(connString);
conn.Open();
In each case, the code fails on the call to Open(). Here's the message I get:
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
Well, that's very helpful. I'm not using a remote connection.
I'm running my Web site in the IDE and will still need to figure out how to connect to the database once I copy the site to my Web hosting account but I can only deal with so much pain at once.
Is there any help available to figure out how to connect to the database I have connected?
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
.
- Follow-Ups:
- Re: What's My Password?
- From: Jonathan Wood
- Re: What's My Password?
- References:
- What's My Password?
- From: Jonathan Wood
- What's My Password?
- Prev by Date: Intermittent TransactionScope communication failures
- Next by Date: how can i get notification from mfc Activex controle
- Previous by thread: Re: What's My Password?
- Next by thread: Re: What's My Password?
- Index(es):
Relevant Pages
|