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"




Reply With Quote