Allow Zero DateTime mysql connector web.config Entity Framework

asp.net asp.net-mvc entity-framework mysql web-config

Question

I'm getting a MySqlConnectionException when i'm trying to connect retrieve data from my DBContext class because i have a date time entry line 0000-00-00 00:00:00.

From what i understand i have to add a Allow Zero Datetime=true entry in my connection string, the one bellow.

<add name="A4LifeEntities" connectionString="metadata=res://*/A4LifeEntities.csdl|res://*/A4LifeEntities.ssdl|res://*/A4LifeEntities.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;password=pass;user id=userId;port=3330;Allow Zero Datetime=true; persist security info=True;database=aLife&quot;" providerName="System.Data.EntityClient"/></connectionStrings>

As you can see i have already added it, but am i doing something wrong ? Do i have to add it somewhere else in the string ? Because it's not working.

Thank you

1
1
3/30/2013 7:44:17 PM

Accepted Answer

Use Convert Zero Datetime=true;, it's different in that it returns DateTime.MinValue instead of a MySqlDateTime.

8
3/31/2013 12:01:29 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow