473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

unable to connect to sql db

I moved my database from one server to another SQL server. I did a backup and restore of the database. I can connect to the database on server A from my asp.net app but when I try to connect to my database server B, I'm gettting 'login failed for user 'username'

I've added the username to the database on server B, I can open up SMS and connect to the database that way, but I can't connect from my asp.net web app.

any suggestions on what may be causing me not to be able to connect to my sql server B database?

Aug 28 '07 #1
21 2291
On Aug 28, 2:47 pm, "Steve" <St...@community.nospam.comwrote:
I moved my database from one server to another SQL server. I did a backup and restore of the database. I can connect to the database on server A from my asp.net app but when I try to connect to my database server B, I'm gettting 'login failed for user 'username'

I've added the username to the database on server B, I can open up SMS and connect to the database that way, but I can't connect from my asp.net web app.

any suggestions on what may be causing me not to be able to connect to my sql server B database?
Hi,
have you checked the connection string in the 'web.config' file?
Try to check if all parameters in the connection string are correct
for the srv B database.

Bye

Aug 28 '07 #2
Yes, I've checked it several times and still unable to connect to it.

I'm lost on it now.
<ci*********@gmail.comwrote in message
news:11**********************@r29g2000hsg.googlegr oups.com...
On Aug 28, 2:47 pm, "Steve" <St...@community.nospam.comwrote:
>I moved my database from one server to another SQL server. I did a backup
and restore of the database. I can connect to the database on server A
from my asp.net app but when I try to connect to my database server B,
I'm gettting 'login failed for user 'username'

I've added the username to the database on server B, I can open up SMS
and connect to the database that way, but I can't connect from my asp.net
web app.

any suggestions on what may be causing me not to be able to connect to my
sql server B database?

Hi,
have you checked the connection string in the 'web.config' file?
Try to check if all parameters in the connection string are correct
for the srv B database.

Bye

Aug 28 '07 #3
On Aug 28, 4:57 pm, "Steve" <St...@community.nospam.comwrote:
Yes, I've checked it several times and still unable to connect to it.

I'm lost on it now.

<ciccone1...@gmail.comwrote in message

news:11**********************@r29g2000hsg.googlegr oups.com...
On Aug 28, 2:47 pm, "Steve" <St...@community.nospam.comwrote:
I moved my database from one server to another SQL server. I did a backup
and restore of the database. I can connect to the database on server A
from my asp.net app but when I try to connect to my database server B,
I'm gettting 'login failed for user 'username'
I've added the username to the database on server B, I can open up SMS
and connect to the database that way, but I can't connect from my asp.net
web app.
any suggestions on what may be causing me not to be able to connect to my
sql server B database?
Hi,
have you checked the connection string in the 'web.config' file?
Try to check if all parameters in the connection string are correct
for the srv B database.
Bye
If you can, you should provide more informations so maybe I can be
more helpful.
What about error message?
Could you post some asp code?

Aug 28 '07 #4
The error i'm getting is

'login failed for user 'username'

I have this as my connection string

<add key="dbConnection"
value="Server=DBServerTest;Database=SalesForTheYea r;User
ID=username;Password=password;Trusted_Connection=F alse;"/>
now, this same connection string works on DBServerDev fine with the same ID
and pwd
<ci*********@gmail.comwrote in message
news:11********************@19g2000hsx.googlegroup s.com...
On Aug 28, 4:57 pm, "Steve" <St...@community.nospam.comwrote:
>Yes, I've checked it several times and still unable to connect to it.

I'm lost on it now.

<ciccone1...@gmail.comwrote in message

news:11**********************@r29g2000hsg.googleg roups.com...
On Aug 28, 2:47 pm, "Steve" <St...@community.nospam.comwrote:
I moved my database from one server to another SQL server. I did a
backup
and restore of the database. I can connect to the database on server A
from my asp.net app but when I try to connect to my database server B,
I'm gettting 'login failed for user 'username'
>I've added the username to the database on server B, I can open up SMS
and connect to the database that way, but I can't connect from my
asp.net
web app.
>any suggestions on what may be causing me not to be able to connect to
my
sql server B database?
Hi,
have you checked the connection string in the 'web.config' file?
Try to check if all parameters in the connection string are correct
for the srv B database.
Bye

If you can, you should provide more informations so maybe I can be
more helpful.
What about error message?
Could you post some asp code?

Aug 28 '07 #5
"Steve" <St***@community.nospam.comwrote in message
news:ez**************@TK2MSFTNGP04.phx.gbl...
The error i'm getting is

'login failed for user 'username'

I have this as my connection string

<add key="dbConnection"
value="Server=DBServerTest;Database=SalesForTheYea r;User
ID=username;Password=password;Trusted_Connection=F alse;"/>

now, this same connection string works on DBServerDev fine with the same
ID and pwd
You've actually created a SQL login called 'username' and given it a
password of 'password'...?

On the assumption that you have, does that login exist on the DBServerTest
box and, if so, does it have the necessary permissions to access the
SalesForTheYear database...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #6
well, I'm not going to show my actualy Id and pwd, but yeah I have the id
and password on my sql server, and I gave it dbowner permission for the
database I need to access with the id and pwd and no luck

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2******************@TK2MSFTNGP06.phx.gbl...
"Steve" <St***@community.nospam.comwrote in message
news:ez**************@TK2MSFTNGP04.phx.gbl...
>The error i'm getting is

'login failed for user 'username'

I have this as my connection string

<add key="dbConnection"
value="Server=DBServerTest;Database=SalesForTheYe ar;User
ID=username;Password=password;Trusted_Connection= False;"/>

now, this same connection string works on DBServerDev fine with the same
ID and pwd

You've actually created a SQL login called 'username' and given it a
password of 'password'...?

On the assumption that you have, does that login exist on the DBServerTest
box and, if so, does it have the necessary permissions to access the
SalesForTheYear database...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #7
"Steve" <St***@community.nospam.comwrote in message
news:us**************@TK2MSFTNGP06.phx.gbl...
well, I'm not going to show my actualy Id and pwd, but yeah I have the id
and password on my sql server, and I gave it dbowner permission for the
database I need to access with the id and pwd and no luck
OK - what happens if you open a SQL query in SQL Management Studio and use
those credentials...?

What do you see when you do a SQL trace...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #8
I can't connect using any credentails, but if I log into the server with the
username and password, I can then open the SQL database via sms.

and the security is set for mixed mode.

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eg**************@TK2MSFTNGP04.phx.gbl...
"Steve" <St***@community.nospam.comwrote in message
news:us**************@TK2MSFTNGP06.phx.gbl...
>well, I'm not going to show my actualy Id and pwd, but yeah I have the id
and password on my sql server, and I gave it dbowner permission for the
database I need to access with the id and pwd and no luck

OK - what happens if you open a SQL query in SQL Management Studio and use
those credentials...?

What do you see when you do a SQL trace...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #9
I just ran a trace and I don't see the connection even trying to happen, but
I get the 'login failed for username' message.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eg**************@TK2MSFTNGP04.phx.gbl...
"Steve" <St***@community.nospam.comwrote in message
news:us**************@TK2MSFTNGP06.phx.gbl...
>well, I'm not going to show my actualy Id and pwd, but yeah I have the id
and password on my sql server, and I gave it dbowner permission for the
database I need to access with the id and pwd and no luck

OK - what happens if you open a SQL query in SQL Management Studio and use
those credentials...?

What do you see when you do a SQL trace...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #10
"Steve" <St***@community.nospam.comwrote in message
news:OK**************@TK2MSFTNGP05.phx.gbl...
>I just ran a trace and I don't see the connection even trying to happen,
but I get the 'login failed for username' message.
In which case, you're either looking at the wrong database or your trace
filter is too restrictive.

If you create a new trace with no filter, and still see nothing, then the
server / database you're running the trace on isn't the same one as your web
app is trying to connect to...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #11
I can't even log into the database using the credentials I'm trying to use
for my asp.net app

so i go to SQL Server Management Studio, use SQL Auth, enter in my ID and
PWD, and I get 'login failed for username'.

BUT if I log into the actual server with 'username' and 'pwd' I can then
open up SQL Server Management Studio and access the database with no
problem.

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:e3**************@TK2MSFTNGP03.phx.gbl...
"Steve" <St***@community.nospam.comwrote in message
news:OK**************@TK2MSFTNGP05.phx.gbl...
>>I just ran a trace and I don't see the connection even trying to happen,
but I get the 'login failed for username' message.

In which case, you're either looking at the wrong database or your trace
filter is too restrictive.

If you create a new trace with no filter, and still see nothing, then the
server / database you're running the trace on isn't the same one as your
web app is trying to connect to...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #12
"Mike" <Mi**@community.nospam.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>I can't even log into the database using the credentials I'm trying to use
for my asp.net app
That would appear to be the problem, then...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #13
but if the ID is under the security tab on the SQL server, what would cause
me not to connect?
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:OW**************@TK2MSFTNGP04.phx.gbl...
"Mike" <Mi**@community.nospam.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>>I can't even log into the database using the credentials I'm trying to use
for my asp.net app

That would appear to be the problem, then...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #14
"Mike" <Mi**@community.nospam.comwrote in message
news:eG**************@TK2MSFTNGP02.phx.gbl...
>>>I can't even log into the database using the credentials I'm trying to
use for my asp.net app

That would appear to be the problem, then...

but if the ID is under the security tab on the SQL server, what would
cause me not to connect?
Difficult to say without seeing your SQL Server, but that's definitely where
the problem lies - nothing to do with ASP.NET per se...

Is the login in question mapped to a user in the database in question...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #15
yes, the ID is mapped to the database. The thing is I can only get the DB
working on the server it was setup on. If I backup and restore the db to
another server no ID works with it.

so i have to do some researching on this I guess

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eR**************@TK2MSFTNGP03.phx.gbl...
"Mike" <Mi**@community.nospam.comwrote in message
news:eG**************@TK2MSFTNGP02.phx.gbl...
>>>>I can't even log into the database using the credentials I'm trying to
use for my asp.net app

That would appear to be the problem, then...

but if the ID is under the security tab on the SQL server, what would
cause me not to connect?

Difficult to say without seeing your SQL Server, but that's definitely
where the problem lies - nothing to do with ASP.NET per se...

Is the login in question mapped to a user in the database in question...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #16
"Mike" <Mi**@community.nospam.comwrote in message
news:u9**************@TK2MSFTNGP02.phx.gbl...
>>>>>I can't even log into the database using the credentials I'm trying to
>use for my asp.net app

That would appear to be the problem, then...

but if the ID is under the security tab on the SQL server, what would
cause me not to connect?

Difficult to say without seeing your SQL Server, but that's definitely
where the problem lies - nothing to do with ASP.NET per se...

Is the login in question mapped to a user in the database in question...?

so i have to do some researching on this I guess
You might get a better response in one of the microsoft.public.sqlserver.*
groups...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #17
I found the issue.
The developer that setup the db on the dev server is using SQL Auth, but
with an windows ID.
so instead of using domain\username using windows auth (like it should be)
he's using sql auth.

So how can I setup the DB to use windows auth but using the
domain\username;password, that i'm specifing?
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eR**************@TK2MSFTNGP03.phx.gbl...
"Mike" <Mi**@community.nospam.comwrote in message
news:eG**************@TK2MSFTNGP02.phx.gbl...
>>>>I can't even log into the database using the credentials I'm trying to
use for my asp.net app

That would appear to be the problem, then...

but if the ID is under the security tab on the SQL server, what would
cause me not to connect?

Difficult to say without seeing your SQL Server, but that's definitely
where the problem lies - nothing to do with ASP.NET per se...

Is the login in question mapped to a user in the database in question...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #18
"Mike" <Mi**@community.nospam.comwrote in message
news:O8**************@TK2MSFTNGP05.phx.gbl...
So how can I setup the DB to use windows auth but using the
domain\username;password, that i'm specifing?
Mixed mode / integrated security:
http://www.google.co.uk/search?sourc...authentication
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 28 '07 #19
I have it setup as that, but still no luck.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eN**************@TK2MSFTNGP06.phx.gbl...
"Mike" <Mi**@community.nospam.comwrote in message
news:O8**************@TK2MSFTNGP05.phx.gbl...
>So how can I setup the DB to use windows auth but using the
domain\username;password, that i'm specifing?

Mixed mode / integrated security:
http://www.google.co.uk/search?sourc...authentication
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 29 '07 #20
On Aug 28, 9:59 pm, "Mike" <M...@community.nospam.comwrote:
So how can I setup the DB to use windows auth but using the
domain\username;password, that i'm specifing?
In this case you should use impersonation in your web application.

Aug 29 '07 #21
I did that to and I got 'login not assocaited with a trusted connection'

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...
On Aug 28, 9:59 pm, "Mike" <M...@community.nospam.comwrote:
>So how can I setup the DB to use windows auth but using the
domain\username;password, that i'm specifing?

In this case you should use impersonation in your web application.

Aug 29 '07 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: StephenRichter | last post by:
I have installed the trial of db2 enterprise server on my w2k PC. Have also installed fix pack 8 of that product. I am using it to connect from an asp.net web page to an IBM as400. the 400 is...
22
by: Kristof Thys | last post by:
Hello, I'm developing a C# - windows forms application. To get some information for my application, I'm connecting to an URL, wich gives me XML generated using php. With 90% of the users, this...
0
by: vicky | last post by:
Hello Experts, Trying to run sample Postgrel's ECPG(Embedded SQL)programs on RHL 9.0. Im unable to connect to PostgreSQL database (sirishadb) when I run the program .... # su postgres...
4
by: newladder | last post by:
Hi all, Iam struck with one of the problem with postgres. Please help me out.... Iam trying to connect to connect to postgres database on remote machine with the IP address 10.2.1.4. Iam unable...
23
cyberking
by: cyberking | last post by:
Hi. I have just started learning PHP along with MySQL. I am trying to connect to the MySQL DB server but unable to. I have been tryin. Please help. Its urgent cos I shall soon have to work on...
1
by: ynyus75 | last post by:
Hey! I am unable to connect some of the services that I host from my laptop at home, such as SMTP and MySQL on port numbers 25 and 3306 respectively. But I am able to some services such as...
1
by: Markw | last post by:
Hi folks I think I've got a variable problem but not 100% sure. Background: I took the CMS example from chapter 6 in "Build your Own Database Driven Website Using PHP&MySQL" and have attempted to...
3
by: Harmony504 | last post by:
HELP! Setup: PHP5.2.5, IIS 5.1, XP, AS/400 (DB/400 or DB2) I am trying to connect to a DB2 database from my computer. I installed DB2 Connect and set up the ODBC Driver in the Data Source...
3
by: yawnmoth | last post by:
I'm trying to connect to an Active Directory server and am having some difficulties. Here's the code I'm using: <?php if (!($ldap = ldap_connect('domain.tld')) { exit('unable to connect'); }...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.