DBNull.Value not supportet?
Posted: Tue 26 Jan 2010 14:35
Hey
I use dotConnect for mySQL with the following code:
When either cmbFarbe.Value or cmbGroesse.Value = NOTHING, then I get an error, that
Any tip do this?
I use dotConnect for mySQL with the following code:
Code: Select all
Dim Groesse As Object = IIf(cmbGrösse.Value Is Nothing, DBNull.Value, cmbGrösse.Value)
Dim Farbe As Object = IIf(cmbFarbe.Value Is Nothing, DBNull.Value, cmbFarbe.Value)
Dim qArtikel = (From Query In LinqProvider.GetProvider.Artikelstamms _
Where Query.Invnr = Convert.ToString(cmbInvNr.Value) And _
Query.Lieferant = Convert.ToInt64(cmbLieferant.Value) And _
Query.Artikelnr = Convert.ToString(cmbArtNummer.Value) And _
Query.Groesse = Groesse And _
Query.Farbe = Farbe).Single
I also tried to set cmbGroesse.Value to "" when it is nothing, but "" is not equal to NULLMethod 'CompareObjectEqual' has no supported translation to SQL.
Any tip do this?