Skip to content
Advertisement

operator ‘||’ cannot be applied to operands of type ‘string’ and ‘string’ ( how i can fix this )

This Is Windows form im newbe and i have not ton of skill but i understand

i have 5 table


layer = layerID int , layerName string ( layerID = PK )

Gor = LayerID int , GroID int , GroNnumber string ( GroID = PK and LayerID = FK )

Gru = GruID int , GroID int , GruNumber string (GruID = PK and GorID = FK )

Das = GruID int , DasID int, DasNumber string (DasID = PK and GruID = FK )

Grop = GropID int , DasID int , GropNumber string (GropID = PD and DasID = FK )

all this 5 table relation ( PK – FK )

i use Join for read all data from this 5 table and my code work as well and i can see all my data from all 4 table inside my datagridview

this is my code

”’

this is my last table

Position = PositionID int, PositionCharts string, PositionName string

PositionCharts Data = ( GruNumber Data,DasNumber Data, GroNumber Data )

Data Something like this

GruNumber , DasNumber , GropNumber

Gru01, Das01, Grop01

Gru02, Das02, Grop02

FreeGru01, FreeDas01, FreeGrop01


PositionCharts : PositionName

FreeGru01: Master

FreeDas01: Member

FreeGrop01: Boss


i use this code for join this data if ( GruNumber or DasNumber or GropNumber = positioncharts ) then i see PositionName in my datagridview too

i change my code to this code

”’

”’ but after i use this code i receive this error

operator ‘||’ cannot be applied to operands of type ‘string’ and ‘string’

i change code to this

”’

”’

not work

and this

”’

”’

not work !

how i can solve this problem ?

Advertisement

Answer

To implement a multiple condition join which is not an AND join with only equality conditions, you must use a cross join. In LINQ, this is implemented by adding another from clause and putting the join conditions in a where:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement