Results 1 to 5 of 5

Thread: [2005] SQL connection problems after using SQL Studio Express

Threaded View

  1. #1

    Thread Starter
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    [2005] SQL connection problems after using SQL Studio Express

    Hi,

    I created a one table DB using SQL Server Studio Express. I've been trying to learn this stuff and created a little app in .net just to display the items in a datagrid. It's all working fine.

    However, I've noticed a strange problem. If I open Studio Express and edit the database, save and close it (studio express). The when i try to re-connect to the DB through my .NET app it wont connect. It says:

    Cannot open user default database. Login failed.
    Login failed for user '####\####

    EDIT: I get the above error at the point of trying to open the connection:
    connAP.Open()

    I've added the # myself but you get the idea. If I restart my computer and just use .NET it connects as normal and works fine. As soon as i've used Studio Express it gives me the error. Any ideas??

    Here's my connection string in case it's important. As i say though i don't have problem connecting unless i use sql studio:
    vb Code:
    1. connAP.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=" & _
    2.        "C:\Temp\DB\jimmy.mdf" & _
    3.         ";Integrated Security=True;Connect Timeout=30;User Instance=True"
    Last edited by stimbo; Mar 22nd, 2007 at 10:29 AM.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width