Hi Expert
I am working with a project in c# vs.net 2005 and sql express as backend. I have successfully completed the works.i want to connect my application and sql express on lan. I have successfully connected the data base one day before but because of some problem i have formated the harddisk on both client and server machines. now my application gives this error.
Create databse permission denied in database 'master'.
An attempt to attach an auto named database for file
C:\myDB.mdf failed.
a database with same name exist , or specified file cannot be opened, or is located on UNC share.


In this regard i have some question and need answers in detail.
1. Is there any way to create a login without using sql management studio.
Using this query "CREATE LOGIN user WITH PASSWORD='pwd'"
It executes successfully but gived this error "Login failed for user user. the user is not associated with a trusted sql server connection"
2. If i login with Windows authentication then gives the error
Create databse permission denied in database 'master'.
An attempt to attach an auto named database for file
C:\myDB.mdf failed.
a database with same name exist , or specified file cannot be opened, or is located on UNC share.
What is the problem with my application?
thnx

Member Avatar for stbuchok

I don't know in detail, but everything is pointing to permissions. Make sure your user has access to do everything you want it to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.