I'm in the process of building a WCF Service Application which connects to an SQL Database using Entity SQL (Entity Framework). At the moment I keep getting this error with several methods:
The data reader has more than one field. Multiple fields are not valid for EDM primitive or enumeration types.
This is an example of one of the methods and would appreciate some advice on how to approach this:
public string[] Tables()
{
string Sql = @"SELECT * FROM information_schema.tables";
using (var Context = new XEntities())
{
Context.Database.Connection.Open();
IEnumerable<string> Query = Context.Database.SqlQuery<string>(Sql);
string[] results = Query.ToArray();
Context.Database.Connection.Close();
return results;
}
The method is supposed to query the database for a list of tables and send them back in an array. This will then be inputted into a ListBox by the Windows Phone App.
Thank You for your time.