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]" <notmyfirstname@xxxxxxxxx> wrote in message news:O4$VNGv3HHA.5424@xxxxxxxxxxxxxxxxxxxxxxx
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" <jwood@xxxxxxxxxxxxxxxx> schreef in bericht news:%23%23hI$7o3HHA.5852@xxxxxxxxxxxxxxxxxxxxxxx
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



.



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)
  • asp.net 2.0 login control
    ... A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] ... These problems left me stranded for days, then today, on another machine, I hit a different set of problems I kept getting the following "Failed to generate user instance of SQL Server due to a failure in starting the process for the user instance. ... (Basically this is a new option in the connection string that allows you to point out where the ..mdf file resides eliminating the need to create database in some SQL instance.) ... Beware that the windows account of the user that first creates the connection in this databaseless manner, becomes exclusive user for this file and no other windows account will be able to create a connection to this file. ...
    (microsoft.public.dotnet.languages.vb)
  • 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: Connection to SQL Server only.
    ... make sure you provide a full path or a path relative to the SQL Server ... >> local database using ADO.NET. ... I am not sure of the connection string I ...
    (microsoft.public.dotnet.framework.adonet)