0

I'm developing a program for a customer who has a mysql server. I dont have the mysql server information because of security then I have been developing it on mysql localhost..

So I sent the program and my customer changed connection strings from config file (myprogram.exe.config) but it doesnt work. after that installed local mysql and tried it again, it also didnt work..

I have never tried make a program with a custom connectionstring.. As you know entity framework creates classes from db's tables. I created script of database...

I am looking for a solution..

this is my config file

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.
EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089" requirePermission="false" />

 <connectionStrings>
<add name="XXXX.Properties.Settings.xxxConnectionString"connectionString= 
"server=localhost;User Id=root;password=*****;Persist Security Info=True;
database=xxx" providerName="MySql.Data.MySqlClient" />

<add name="xxxxEntity" connectionString="metadata=res://*/xxxxModel.csdl|res:
//*/xxxModel.ssdl|res://*/xxxModel.msl;provider=MySql.Data.MySqlClient;provider 
connection string=&quot;server=localhost;user id=root;password=*****;
persist security info=True;database=xxxx&quot;" providerName=
"System.Data.EntityClient" />
</connectionStrings>

and my customer changed like that

<add name="TopluFatura.Properties.Settings.xxxxxConnectionString" 
connectionString="server=IP_ADDRESS;User Id=root;password=------;
Persist Security Info=True;database=xxxxx"providerName="MySql.Data.MySqlClient"/>
<add name="xxxxEntity" connectionString="metadata=res://*/xxxxModel.csdl|
res://*/xxxxModel.ssdl|res://*/xxxxModel.msl;provider=MySql.Data.MySqlClient;
provider connectionstring=&quot;server=IP_ADDRESS;user id=root;password=------;
persist security info=True;database=xxxx&quot;"
providerName="System.Data.EntityClient" />
ertan2002
  • 1,458
  • 1
  • 32
  • 68
  • What error you are seeing when change to the new connection string? – Jhonatas Kleinkauff May 07 '13 at 11:23
  • thanx for answer, We get "application has stopped working" this error and no any info.. – ertan2002 May 07 '13 at 11:29
  • Ok. Try to put your EF constructor(or where you use the connString) in try/catch block. Just to see if we can handle the real error message. – Jhonatas Kleinkauff May 07 '13 at 11:32
  • I put this connction string to constructor of entity server=localhost;user id=root;password=******;persist security info=True;database=xxxx and an argumentexception ocurred that is Keyword not supported: 'server'. – ertan2002 May 07 '13 at 11:36
  • Wow. You are using the right data provider to connect to MySql right? See [here](http://stackoverflow.com/questions/76488/using-mysql-with-entity-framework) – Jhonatas Kleinkauff May 07 '13 at 11:40
  • It is already in app.config but I have found http://msdn.microsoft.com/en-us/library/bb738533.aspx this code and it works.. I am going to send new code to my customer and let me see whether it works.. and thank you for your interest :) – ertan2002 May 07 '13 at 11:43

0 Answers0