[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"
Re: [2005] SQL connection problems after using SQL Studio Express
After making your change in SQL, refresh the connection string before running your application.
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.
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.
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.