Re: What's My Password?



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



.



Relevant Pages

  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Logging in in background
    ... wold take all kinds of modifictions as I'd need to be checking that each SQL ... my database and all have connection strings associated with them. ... I suspect that there is also an issue on the SQL Server side as I keep ...
    (microsoft.public.access.modulesdaovba)
  • Re: User not associated with trusted SQL Server connection
    ... > using the osql utility. ... > associated with a trusted SQL Server connection. ... > database or is it just for that instance. ...
    (microsoft.public.sqlserver.security)
  • VS 2008 Team - Database not supported / Cant load file or assembly
    ... Visual Studio 2008 Team Database Edition ... SQL Server 2005 Enterprise SP2 ... Unable to add data connection. ...
    (microsoft.public.vstudio.general)
  • Re: How do i move an SQLDatabase to another location?
    ... I went to my clients and installed SQL Server ... Express and copied my database to the same location it was in while i was ... knowing that i can bring a database with me and install ...
    (microsoft.public.dotnet.framework.adonet)