Using Entity Framework 4 CTP
I'm trying to use Entity Framework 4 CTP with my application but I'm not quite getting the results I expected (fully functional, clean application setup).
My connection string is copied from the Application details on the Appharbor Dashboard, I'm creating my entities as normal and I'm doing the same with my DbContext class. But when I try to access any entity I keep getting various errors such as:
A network-related or instance-specific error occurred 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.
or
The provider did not return a ProviderManifestToken string
The connection string name is the same as my DbContext class. I've also tried to do define a default constructor that called the base constructor passing the database name (in the form db***).
Can someone please provide me with some sort of resolution for this problem?
Thanks!
Discussions are closed to public comments.
If you need help with AppHarbor please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by friism on 27 Jan, 2011 12:47 AM
Entity Framework connectionstrings are apparently a little more involved than what we display in the AppHarbor dashboard. Microsoft documentation here.
I've gotten it to work for one of my own projects with a connectionstring like this:
Let me know if this doesn't work out for you.
friism closed this discussion on 27 Jan, 2011 12:47 AM.
Fábio Oliveira re-opened this discussion on 27 Jan, 2011 11:35 AM
2 Posted by Fábio Oliveira on 27 Jan, 2011 11:35 AM
Hi, thanks for the response, but I'm still having problems and can't connect to the DB.
I used the connection string you provided and the application still isn't connecting to the database. It throws a 'ArgumentException' with message
So I added the following to my web.config file
And yet it still gives me the error.
If I change my DbContext class so it creates a database with a name I want (db***) via default constructor, I'm still getting
Support Staff 3 Posted by friism on 28 Jan, 2011 07:26 AM
Hm, that's strange. Does your EF stuff run on your local machine? What connectionstring do you use then? Also, could you post the AppHarbor connectionstring you are trying to use currently, with the password omitted?
4 Posted by danesparza on 06 Feb, 2011 05:03 AM
I'm currently using EF 4 in an ASP.NET MVC2 project on AppHarbor using the connection string method (spec?) mentioned by Michael Friis here: http://msdn.microsoft.com/en-us/library/cc716756.aspx -- seems to work fine for me.
Support Staff 5 Posted by rune on 06 Feb, 2011 06:16 AM
Thanks for the inputs Dan.
I'm closing this issue for now - let us know if you're still having problem with this Fábio.
Best regards,
Rune
rune closed this discussion on 06 Feb, 2011 06:16 AM.