Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem connecting to my database

Reply
Thread Tools

Problem connecting to my database

 
 
=?Utf-8?B?UGF0cmljayBG?=
Guest
Posts: n/a
 
      07-21-2006
Hi, im using C#
Now im trying to get a connection to my database but i keep getting:
Exception Details: System.Data.SqlClient.SqlException: Cannot open database
"PafoDB" requested by the login. The login failed.
Login failed for user 'PAFO-3465A99C7D\Pafo'.

Im trying to use this connection string:
<add name="MyLocalSQLServer" connectionString="Database={PafoDB};Initial
Catalog=PafoDB;data source=localhost;Integrated Security=SSPI;" />

Just cant seem to get it to work, have tried everything i can think of. I am
using MSSQL server 2005
 
Reply With Quote
 
 
 
 
bmomalley@gmail.com
Guest
Posts: n/a
 
      07-21-2006
I'm not sure if this will or won't help, but I'll toss it out there:

CONNECTION STRING CATALOG:
http://www.carlprothman.net/Default.aspx?tabid=81

Good luck!
- Bryan


Patrick F wrote:
> Hi, im using C#
> Now im trying to get a connection to my database but i keep getting:
> Exception Details: System.Data.SqlClient.SqlException: Cannot open database
> "PafoDB" requested by the login. The login failed.
> Login failed for user 'PAFO-3465A99C7D\Pafo'.
>
> Im trying to use this connection string:
> <add name="MyLocalSQLServer" connectionString="Database={PafoDB};Initial
> Catalog=PafoDB;data source=localhost;Integrated Security=SSPI;" />
>
> Just cant seem to get it to work, have tried everything i can think of. I am
> using MSSQL server 2005


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      07-21-2006
Hard to say for sure, but I can see at least one issue. You're using
"Database" and "Initial Catalog" - both mean the same thing. I'm not as
familiar with SQL Server 2005 as I am with SQL Server 2000, but I am sure
that "Initial Catalog" is valid for SQL Server 2005.

Your Connection String indicates that you're using a "trusted connection"
(it's the same as if you used "Trusted_Connection=True"). This means that
the credentials that your app is using will be used for the login. From the
exception, it looks like the account is 'PAFO-3465A99C7D\Pafo'. Hard to say
for sure, but that looks like a local machine account. Could be a domain
name. You would know, I think. What sort of permissions does this account
have with your SQL Server?

You may find the following web site helpful with Connection Strings in the
future:

http://www.connectionstrings.com/

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.




"Patrick F" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, im using C#
> Now im trying to get a connection to my database but i keep getting:
> Exception Details: System.Data.SqlClient.SqlException: Cannot open
> database
> "PafoDB" requested by the login. The login failed.
> Login failed for user 'PAFO-3465A99C7D\Pafo'.
>
> Im trying to use this connection string:
> <add name="MyLocalSQLServer" connectionString="Database={PafoDB};Initial
> Catalog=PafoDB;data source=localhost;Integrated Security=SSPI;" />
>
> Just cant seem to get it to work, have tried everything i can think of. I
> am
> using MSSQL server 2005



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Problem connecting to Access Database from ASP.NET Application Nathan Sokalski ASP .Net 9 06-08-2005 05:29 PM
Problem connecting to Access Database - "already opened exclusively by another user" Tom Wild ASP .Net 1 08-25-2003 06:36 AM
Problem connecting to database - "already opened exclusively by another user, or you need permission to view its data" Tom Wild ASP .Net 0 08-14-2003 12:23 AM



Advertisments