Click here to Skip to main content
15,887,683 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DJB2 Hash algorithm for VB Pin
Richard MacCutchan18-Jan-15 2:17
mveRichard MacCutchan18-Jan-15 2:17 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax18-Jan-15 3:32
SepPax18-Jan-15 3:32 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax18-Jan-15 9:02
SepPax18-Jan-15 9:02 
QuestionVisual Studio 2010 Express on Windows 8.1 Pin
BobbyStrain12-Jan-15 14:11
BobbyStrain12-Jan-15 14:11 
AnswerRe: Visual Studio 2010 Express on Windows 8.1 Pin
vbmike13-Jan-15 4:15
vbmike13-Jan-15 4:15 
AnswerRe: Visual Studio 2010 Express on Windows 8.1 Pin
RUs12313-Jan-15 4:19
RUs12313-Jan-15 4:19 
GeneralRe: Visual Studio 2010 Express on Windows 8.1 Pin
BobbyStrain13-Jan-15 5:06
BobbyStrain13-Jan-15 5:06 
QuestionWhy this expression produce error Pin
dilkonika12-Jan-15 6:31
dilkonika12-Jan-15 6:31 
I'm working with vb.net and entity framework.

In my form , I have 2 comboboxes : Article and price. ( For both comboboxes , .Selectedvalue is an integer )

If I use this expression :
SQL
Dim gj As IEnumerable(Of Myobject)
 gj = (From t In context.myobjects Where t.art = Article.SelectedValue And t.prc = price.SelectedValue
       Select t).ToList



an error is produced :

An unhandled exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dllAdditional information: LINQ to Entities does not recognize the method 'System.Object CompareObjectEqual(System.Object, System.Object, Boolean)' method, and this method cannot be translated into a store expression.

If I use this code :
VB
Dim a as integer=Article.SelectedValue
 Dim c as integer= price.selectedvalue
 Dim gj As IEnumerable(Of Myobject)
 gj = (From t In context.myobjects Where t.art = a And t.prc = c
       Select t).ToList



everything is OK.

What I have wrong in first expression , and how should I modify to make it work , because I don't want to use extra variables like in the second code.

Thank you !
AnswerRe: Why this expression produce error Pin
Richard Deeming12-Jan-15 6:56
mveRichard Deeming12-Jan-15 6:56 
GeneralRe: Why this expression produce error Pin
dilkonika12-Jan-15 7:12
dilkonika12-Jan-15 7:12 
AnswerRe: Why this expression produce error Pin
ZurdoDev12-Jan-15 7:23
professionalZurdoDev12-Jan-15 7:23 
GeneralRe: Why this expression produce error Pin
dilkonika12-Jan-15 7:32
dilkonika12-Jan-15 7:32 
GeneralRe: Why this expression produce error Pin
ZurdoDev12-Jan-15 7:38
professionalZurdoDev12-Jan-15 7:38 
GeneralRe: Why this expression produce error Pin
dilkonika12-Jan-15 7:50
dilkonika12-Jan-15 7:50 
GeneralRe: Why this expression produce error Pin
ZurdoDev12-Jan-15 7:52
professionalZurdoDev12-Jan-15 7:52 
GeneralRe: Why this expression produce error Pin
dilkonika12-Jan-15 16:48
dilkonika12-Jan-15 16:48 
GeneralRe: Why this expression produce error Pin
ZurdoDev13-Jan-15 1:34
professionalZurdoDev13-Jan-15 1:34 
GeneralRe: Why this expression produce error Pin
dilkonika13-Jan-15 4:19
dilkonika13-Jan-15 4:19 
AnswerRe: Why this expression produce error Pin
ZurdoDev13-Jan-15 4:21
professionalZurdoDev13-Jan-15 4:21 
GeneralRe: Why this expression produce error Pin
dilkonika13-Jan-15 4:29
dilkonika13-Jan-15 4:29 
AnswerRe: Why this expression produce error Pin
ZurdoDev13-Jan-15 4:32
professionalZurdoDev13-Jan-15 4:32 
GeneralRe: Why this expression produce error Pin
dilkonika13-Jan-15 5:00
dilkonika13-Jan-15 5:00 
QuestionHow to implement the Bernstein crc ? Pin
SepPax8-Jan-15 13:09
SepPax8-Jan-15 13:09 
QuestionGet messages sent to external ComboBox Pin
ezio20007-Jan-15 5:40
ezio20007-Jan-15 5:40 
AnswerRe: Get messages sent to external ComboBox Pin
Richard Andrew x647-Jan-15 17:23
professionalRichard Andrew x647-Jan-15 17:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.