This is a migrated thread and some comments may be shown as answers.

Date query

2 Answers 51 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nils C.
Top achievements
Rank 1
Nils C. asked on 17 Oct 2012, 02:07 PM

Hi,

we just switched from linq2sql to oAORM and now many querys not working any more. Why is for example the following query not working? I don't understand the failure..


Public Function check_bruteversuch(user As String) As Boolean

        Dim max_zeit As New TimeSpan(0, 10, 0)

        Dim bruteforce = (From it In _dbmaster.Loginspeicher _

                          Where it.Customer = HttpContext.Current.Request.Url.Host.ToString _

                          And it.Benutzername = user _

                          And it.War_erfolgreich = False _

                          And (Now - it.Datum) < max_zeit _

                          Select it).Count


An exception occured during the execution of 'Extent<pms_neu.Loginspeicher>().Where(it => (((Convert(((CompareString(it.Customer, HttpContext.Current.Request.Url.Host.ToString(), False) == 0) And (CompareString(it.Benutzername, value(pms_neu.login_helper+_Closure$__1).$VB$Local_user, False) == 0))) And (it.War_erfolgreich == Convert(False))) And ((Convert(DateAndTime.Now) - it.Datum) < Convert(value(pms_neu.login_helper+_Closure$__1).$VB$Local_max_zeit))) ?? False)).Select(it => it).Count()'. Failure: No AdoTypeConverter has been registered for the clrType.

2 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 18 Oct 2012, 02:26 PM
Hello Nils,

OpenAccess uses the so called "AdoTypeConverters" which translate the database data types to CLR types. It seems for some of the properties in your model there is no converter set. Did you use the Convert from L2S to OpenAccess model wizard or created the model manually from your database? If you used the conversion wizard, this could be a problem which we need to fix.
Unfortunately we will not be able to help much without looking at your model. Could you plŠµase send us a support ticket and attach your rlinq file, so we could test it on our side?

Kind regards,
Alexander
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
0
Nils C.
Top achievements
Rank 1
answered on 18 Oct 2012, 03:10 PM
Hi,

the latest internal build (924) fixed the problem for me! :)

Thanks

Nils
Tags
LINQ (LINQ specific questions)
Asked by
Nils C.
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Nils C.
Top achievements
Rank 1
Share this question
or