DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 14 Aug 2007 10:20:02 -0600,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    Jonathan Wood
          2    Cor Ligthert[MVP]
                 3    Jonathan Wood


Database Connection Problems   
I'm new to SQL Server and seem to have a lot of problems with my connection 
string not working. I finally got it working on one system but then it 
stopped working when I moved to another system. Can anyone give me some 
ideas as to why?

IMPORTANT: This is not on the final Web-hosting machine. I'm just trying to 
get it running on my production machine for development and testing.

My current connection string is "Server=.\SQLEXPRESS;Integrated 
security=SSPI;Initial Catalog=BlackBelt".

Which gives me the error "Cannot open database "BlackBelt" requested by the 
login. The login failed. Login failed for user 'Jonathan-PC\Jonathan'."

I'm running as an administrator on Vista and, when I right-click on the 
database (BlackBelt.mdf) in the Server Explorer and select the Modify 
Connection command, I see 'Use
Windows Authentication' is selected, for which I obviously have correct 
authentication. And if I click 'Test Connection' from this same dialog, it 
reports that the connection succeeded.

I have SQL Server Express installed and SQL Server Configuration Manager is 
setup as follows:

SQL Server 2005 Services
- SQL Server (SQLEXPRESS) = Running
- SQL Server Browser = Stopped
SQL Server 2005 Network Configuration
- Protocols for SQLEXPRESS
   - Shared Memory = Enabled
   - Named Pipes = Disabled
   - TCP/IP = Disabled
   - VIA = Disabled
SQL Native Client Configuration
- Client Protocols
   - Shared Memory = Enabled
   - Named Pipes = Enabled
   - TCP/IP = Enabled
   - VIA = Disabled
Aliases
  (Empty)

I was able to get it working with the connection string "Data 
Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Jonathan\Documents\Visual 
Studio 2005\WebSites\BlackBelt\App_Data\BlackBelt.mdf;Integrated 
Security=True;User Instance=True" but I have no idea why and some folks told 
me that there are problems connecting with User Instance = True.

I don't get why I'm having so much trouble with this. Any suggestions 
appreciated.

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
Date:Tue, 14 Aug 2007 10:20:02 -0600   Author:  

Re: Database Connection Problems   
Johnatan,

Are you sure that you have integrated rights on that other machine. In my 
expirience that is the most common problem. You can maybe make a connection 
with SQL authentication.

Cor

"Jonathan Wood"  schreef in bericht 
news:%23%23hI$7o3HHA.5852@TK2MSFTNGP02.phx.gbl...

> I'm new to SQL Server and seem to have a lot of problems with my 
> connection string not working. I finally got it working on one system but 
> then it stopped working when I moved to another system. Can anyone give me 
> some ideas as to why?
>
> IMPORTANT: This is not on the final Web-hosting machine. I'm just trying 
> to get it running on my production machine for development and testing.
>
> My current connection string is "Server=.\SQLEXPRESS;Integrated 
> security=SSPI;Initial Catalog=BlackBelt".
>
> Which gives me the error "Cannot open database "BlackBelt" requested by 
> the login. The login failed. Login failed for user 
> 'Jonathan-PC\Jonathan'."
>
> I'm running as an administrator on Vista and, when I right-click on the 
> database (BlackBelt.mdf) in the Server Explorer and select the Modify 
> Connection command, I see 'Use
> Windows Authentication' is selected, for which I obviously have correct 
> authentication. And if I click 'Test Connection' from this same dialog, it 
> reports that the connection succeeded.
>
> I have SQL Server Express installed and SQL Server Configuration Manager 
> is setup as follows:
>
> SQL Server 2005 Services
> - SQL Server (SQLEXPRESS) = Running
> - SQL Server Browser = Stopped
> SQL Server 2005 Network Configuration
> - Protocols for SQLEXPRESS
>   - Shared Memory = Enabled
>   - Named Pipes = Disabled
>   - TCP/IP = Disabled
>   - VIA = Disabled
> SQL Native Client Configuration
> - Client Protocols
>   - Shared Memory = Enabled
>   - Named Pipes = Enabled
>   - TCP/IP = Enabled
>   - VIA = Disabled
> Aliases
>  (Empty)
>
> I was able to get it working with the connection string "Data 
> Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Jonathan\Documents\Visual 
> Studio 2005\WebSites\BlackBelt\App_Data\BlackBelt.mdf;Integrated 
> Security=True;User Instance=True" but I have no idea why and some folks 
> told me that there are problems connecting with User Instance = True.
>
> I don't get why I'm having so much trouble with this. Any suggestions 
> appreciated.
>
> -- 
> Jonathan Wood
> SoftCircuits Programming
> http://www.softcircuits.com
> 
Date:Wed, 15 Aug 2007 06:05:41 +0200   Author:  

Re: Database Connection Problems   
It looks like I have this figured out thanks to help from someone else.

I didn't really understand your reply. Not only am I not sure I have 
integrated rights on the other machine, but I have no idea what that means. 
And I don't get the comment about SQL authentication either.

What I didn't understand before (and wasn't made clear in the many related 
discussions I've had), is that you can create a database that is not 
attached to the SQL server. The common connection strings I've encountered 
only work when the database is provided by the SQL server. Otherwise, you 
need to use AttachDbFilename. I'm still not sure about User Instance, but I 
can figure that out in good time.

Thanks.

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Cor Ligthert[MVP]"  wrote in message 
news:O4$VNGv3HHA.5424@TK2MSFTNGP02.phx.gbl...

> Johnatan,
>
> Are you sure that you have integrated rights on that other machine. In my 
> expirience that is the most common problem. You can maybe make a 
> connection with SQL authentication.
>
> Cor
>
> "Jonathan Wood"  schreef in bericht 
> news:%23%23hI$7o3HHA.5852@TK2MSFTNGP02.phx.gbl...
>> I'm new to SQL Server and seem to have a lot of problems with my 
>> connection string not working. I finally got it working on one system but 
>> then it stopped working when I moved to another system. Can anyone give 
>> me some ideas as to why?
>>
>> IMPORTANT: This is not on the final Web-hosting machine. I'm just trying 
>> to get it running on my production machine for development and testing.
>>
>> My current connection string is "Server=.\SQLEXPRESS;Integrated 
>> security=SSPI;Initial Catalog=BlackBelt".
>>
>> Which gives me the error "Cannot open database "BlackBelt" requested by 
>> the login. The login failed. Login failed for user 
>> 'Jonathan-PC\Jonathan'."
>>
>> I'm running as an administrator on Vista and, when I right-click on the 
>> database (BlackBelt.mdf) in the Server Explorer and select the Modify 
>> Connection command, I see 'Use
>> Windows Authentication' is selected, for which I obviously have correct 
>> authentication. And if I click 'Test Connection' from this same dialog, 
>> it reports that the connection succeeded.
>>
>> I have SQL Server Express installed and SQL Server Configuration Manager 
>> is setup as follows:
>>
>> SQL Server 2005 Services
>> - SQL Server (SQLEXPRESS) = Running
>> - SQL Server Browser = Stopped
>> SQL Server 2005 Network Configuration
>> - Protocols for SQLEXPRESS
>>   - Shared Memory = Enabled
>>   - Named Pipes = Disabled
>>   - TCP/IP = Disabled
>>   - VIA = Disabled
>> SQL Native Client Configuration
>> - Client Protocols
>>   - Shared Memory = Enabled
>>   - Named Pipes = Enabled
>>   - TCP/IP = Enabled
>>   - VIA = Disabled
>> Aliases
>>  (Empty)
>>
>> I was able to get it working with the connection string "Data 
>> Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Jonathan\Documents\Visual 
>> Studio 2005\WebSites\BlackBelt\App_Data\BlackBelt.mdf;Integrated 
>> Security=True;User Instance=True" but I have no idea why and some folks 
>> told me that there are problems connecting with User Instance = True.
>>
>> I don't get why I'm having so much trouble with this. Any suggestions 
>> appreciated.
>>
>> -- 
>> Jonathan Wood
>> SoftCircuits Programming
>> http://www.softcircuits.com
>>
> 
Date:Tue, 14 Aug 2007 23:08:01 -0600   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us