2

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?

1
  • server=./SqlExpress; should not it be server=.\SqlExpress;? Commented Nov 8, 2012 at 16:06

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

3 Comments

no actually I'm not sure , I'm brand new to this , I was following a video tutorial and I did everything according to it. but I got this Error. can you explain what you mean by active directory username?
In you case you add your windows user, the same you have in the error message. Make sure that you check dbowner in options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.