Code: Select all
var db = new MyDataContext();
var data = db.ExecuteQuery("select Hello, World from myTable");
Code: Select all
public class MyModel
{
public string Hello { get; set; }
public string World { get; set; }
}
Code: Select all
public class MyModel
{
private string hello;
public string Hello
{
get { return hello; }
set { hello= value; }
}
private string world;
public string World
{
get { return world; }
set { world= value; }
}
}
Code: Select all
System.InvalidOperationException was unhandled by user code
Message="Field with name k__BackingField is not found in resultset."
Source="Devart.Data.Linq"
StackTrace:
at Devart.Data.Linq.Provider.g.a(IDataRecord A_0, String A_1, DataSourceInfo A_2)
at lambda_method(ExecutionScope , b )
at Devart.Data.Linq.Provider.ObjectReader`1.g()
at Devart.Data.Linq.Provider.ObjectReader`1.b()
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at com.blah.MyApp.Services.GetMyModel(String user, DateTime dateTime) in C:\blah
at com.blah.MyApp.web.Controllers.MyModelController.ImpactToday() in C:\blah
at lambda_method(ExecutionScope , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.c__DisplayClassd.b__a()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
InnerException:
Thanks