Question

I Tried to use the code first approach to create my database I created every class that I needed and then added a web form to my project and a grid view to it. then I tried to set the grid view's data source to the data base. when I want to Choose a new connection it actually finds my database automatically named "TimeTrackerDbContext" but when I hit next I get this error : "Database Schema Could not be retrieved for this connection. A network related or instance-specific error occured while establishing a connection to sql server. the server was not found or was not accessible. verify that the instance name is correct and that sql server is configured to allow remote connections. (provider: Named Pipes Provider, error:40 - Could not open a connection to SQL Server) at DataObjectSupport(422,6)"

my connection strings section in web.config is: "name="TimeTrackerDbContext" connectionString="server=./SqlExpress;integrated security=SSPI; database =TimeTracker" providerName="System.Data.SqlClient"

and I use win 8. Can you help?

Was it helpful?

Solution

Are you sure your active directory username is dbowner if this database? You need to have the rights to create objects in this database

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top