Last post Sep 06, 2007 12:47 AM by tekila
Aug 08, 2007 03:32 AM|erdsah88|LINK
var db = new DBOEODataContext();
var persons1 = db.ExecuteQuery<PERSON>("SELECT _NAME FROM PERSON");
I get an exception > InvalidOperationException
The required column '[_ID]' does not exist in the results.
what should I do ?
Aug 08, 2007 01:46 PM|phuff|LINK
Is this Blinq-generated code? It doesn't look like it...
Offhand, I'd say change your code to include the _ID field.
var persons1 = db.ExecuteQuery<PERSON>("SELECT _NAME, _ID FROM PERSON");
But really, the whole point of Linq is that you don't have to write SQL commands anymore. Why not just write
var persons = from Persons select _name, _id;
Aug 08, 2007 02:33 PM|erdsah88|LINK
I need dynamic Sql where I have interfaces that has conditions for that.
I need to be able to use runtime times with the linQ ...
Sep 03, 2007 11:06 PM|tekila|LINK
i have the same problem
if linq will not support executeQuery correctly then it's useless
Sep 04, 2007 06:14 AM|erdsah88|LINK
Sep 04, 2007 01:18 PM|tekila|LINK
the interesting thing about this exception,
i tried to use storeproc and the same problem exist with storeproc
i think it's a bug and i hope they will fixt it,
of cource there is allways a solution with ado.net but in this case why linq exist[:)]
i will try something else and if i fixt it i let you know
Sep 06, 2007 12:47 AM|tekila|LINK
ok I'v solved your problem and it's really funy but executeQuery methos works very well even fulltext search
accualy the funny problem is your _ID name don't use '_' underscor because if you notice context class use this underscorr every varible that's why throw exeption
i have tried change _ID name to IDD in context designer but it does't help
you have to change your _ID name something else in your database
by the way ilkona'a selamlar...