I am creating an application which uses databases extensively. Now we are using Mysql connector, plain sql syntax to make our needs. Now we are trying to employ LINQ for the database queries. So I am trying to implement the DBcontext
. But it is not connecting properly. The problem is in connection string.
This is the method I am using now,
class My_DB_Context: DB_Context
{
public My_DB_Context(string connection_String):base(connection_String){}
void make_Some_Transaction(){}
}
public void Main()
{
string conn_Str = "SERVER=localhost;DATABASE=my_DB;UID=temp_User;PASSWORD=password;";
My_DB_Context temp = new My_DB_Context();
temp.make_Some_Transaction();
}
Can anybody say how to achieve this?. There are numerous post about how to achieve this in ASP.Net . But, I couln't find one for console like application. This article promises that this is possible.
Note: I am using C#/.Net 4.0. Visual Studio 2010, Entity Framework 5.0.0
EDIT-1: I forgot to mention that I know nothing in ASP.Net . So , I can't understand the parameters they changed in that article. These are exception messages I am getting
An error occurred while getting provider information from the database. This can be
caused by Entity Framework using an incorrect connection string. Check the inner
exceptions for details and ensure that the connection string is correct.
Below is the inner exception
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"
EDIT-2: After Ingo's comment, now only I noticed that they released it on yesterday only. But, this issue is very basic . They wont change these kind of things easily. So, answers for old Entity FrameWorks also welcomed by betting on compatibility.
EDIT-3: I saw something called as entity_Connection_String. I think this is the thing I have to dig.