|
-
Mar 22nd, 2007, 10:24 AM
#1
Thread Starter
Frenzied Member
[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:
connAP.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=" & _
"C:\Temp\DB\jimmy.mdf" & _
";Integrated Security=True;Connect Timeout=30;User Instance=True"
Last edited by stimbo; Mar 22nd, 2007 at 10:29 AM.
-
Mar 22nd, 2007, 10:40 AM
#2
Fanatic Member
Re: [2005] SQL connection problems after using SQL Studio Express
After making your change in SQL, refresh the connection string before running your application.
-
Mar 22nd, 2007, 10:46 AM
#3
Thread Starter
Frenzied Member
Re: [2005] SQL connection problems after using SQL Studio Express
It doesn't matter if I shut down .NET and start up the application again, it still wont work.
The only thing that sorts it out is a reboot.
-
Mar 22nd, 2007, 05:22 PM
#4
Re: [2005] SQL connection problems after using SQL Studio Express
Why would you be using Management Studio Express to make changes anyway? You can make any changes you require in Visual Studio. I'm fairly certain that VB Express is the same.
-
Mar 22nd, 2007, 07:27 PM
#5
Thread Starter
Frenzied Member
Re: [2005] SQL connection problems after using SQL Studio Express
I was using it because I was following tutorials etc... and it just seemed easier to use management studio because that's what they were in. I also wanted to use it because.... well I wanted to try it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|