title: Why is there an input string exception for a query without where clause?
body: <p>Using ASP.NET MVC 2, Entity Framework, MySQL, VS2010 Ultimate. I have researched long but running out of clue for general Input Exception hit from my code. Although I have removed all the where clause:</p>
  
  <pre><code>var record = (from staff in pmsEntities.ef_staff                          
                             select staff
                             ).FirstOrDefault();
  </code></pre>
  
  <blockquote>
    <p>[FormatException: Input string was not in a correct format.]    </p>
  
  <pre><code>System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal) +9594283    
  System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119    
  System.String.System.IConvertible.ToInt32(IFormatProvider provider) +46    
  System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +385   
  MySql.Data.Entity.EFMySqlDataReader.ChangeType(Object sourceValue, Type targetType) +566    
  MySql.Data.Entity.EFMySqlDataReader.GetValue(Int32 ordinal) +231    
  System.Data.Common.Internal.Materialization.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal) +215    
  System.Data.Common.Internal.Materialization.Shaper.GetPropertyValueWithErrorHandling(Int32 ordinal, String propertyName, String typeName) +68    
  lambda_method(Closure , Shaper ) +1088    
  System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly(Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet) +218    
  lambda_method(Closure , Shaper ) +291    
  System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper) +170    
  System.Data.Common.Internal.Materialization.SimpleEnumerator.MoveNext()  +84    
  System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +4187840    
  System.Data.Objects.ELinq.ObjectQueryProvider.&lt;GetElementFunction&gt;b__1(IEnumerable`1 sequence) +41    
  System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +59    
  System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +150    
  System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +265    
  IDP.Models.Login.IsValid(String _username, String _pwd, Int32 _type) in C:\Users\george\Desktop\Um\idp\nur\IDP\IDP\Models\Login.cs:36
  </code></pre>
  </blockquote>