Re: What's My Password?




Where is it asking you for the username and password? Because
if I use integrated security, it doesn't ask me, it collects
that information from Windows.

Here's an example of connection string I'm using:

Data Source=xMyMachineName\xMySQLServerName;Initial
Catalog=myFavoriteDB;Integrated Security=True

If you have SQLServerExpress installed, the default
name is the computer name with \SQLExpress appended to it.
To find your computer name, right-click on My Computer
and choose the tab "Computer Name".

To create a SQLServer database using Server Explorer in VS2005:

Click on View/ServerExplorer.

Right-click on the Data Connections node and select
Create New SQL Server Database from the context menu.
This displays the Create New SQL Server Database dialog.

Select the name of the SQL Server you want to use.
You may not see your SQLServer Express edition appear
in the list. If yot, you can type it in as <your machine
name>\SQLExpress or as (local)\SQLExpress or just .\SQLExpress.

Define the appropriate info to log into the selected SQL Server.
By default, SQL Server Express is installed with Windows
Authenticaion in place.

Define the name of the database.

Click <OK>.

After it's in the Server Explorer, you can create tables
in the database, add data, create stored procedures, etc.

Does this work for you?

Robin S.
-------------------------------

"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:OUEkkj1MHHA.5064@xxxxxxxxxxxxxxxxxxxxxxx
"RobinS" <RobinS@xxxxxxxxxxxxxxx> wrote in message
news:SbGdndray_KFDz_YnZ2dnUVZ_ualnZ2d@xxxxxxxxxxxxxx
I hardly think it's the fault of the books on ADO. I can
understand how they would think you know your own username
and password in SQLServer.

So is that what it's asking me? The user name and password to my
computer? If so, that would be at least one new thing I've learned.
That is not obvious to me at all. And, of course, begs the question as
to what they'll be on my host server.


Now , if it was a book on SQLServer, that might be a
different issue.

Robin S.
--------------------------
"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> wrote in message
news:edejNiuMHHA.420@xxxxxxxxxxxxxxxxxxxxxxx
Johanthan,

We all try to learn on this board, will you next time the name of
books you have used as well.

Thank you for informing us that we have to watch this when we buy
books about AdoNet.

Cor


"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> schreef in bericht
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: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Help! Set up Windows Group to access application
    ... The connection string for a trusted connection is: ... --add login as database user ... SQL Server MVP ... If you have troubles with finding your ways in Crystal Reports, ...
    (microsoft.public.sqlserver.security)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Getting started in IT.
    ... Have ordered both books. ... MCITP SQL Server 2005 Database Administration All-in-One Exam Guide ...
    (microsoft.public.cert.mcdba)

Loading