c# - Multiple Joins with multiple conditions -
i trying list out grid view of cities have respective country , area status true.
here hierarchy country
-> area
-> city
.here's code.
somehow shows error joins:-
the type of 1 of expression in join clause incorrect.type inference failed call join
what missing?
protected void fn_fill_city() { ef_dv.dbentities city_context = new ef_dv.dbentities(); try { var row_city = (from city_table in city_context.dv_tbl_city join country_table in city_context.dv_tbl_country on new { c_id = city_table.city_country_id, c_status = true } equals new { c_id = country_table.country_id, c_status = country_table.country_status } join area_table in city_context.dv_tbl_area on new { area_id = city_table.city_area_id, a_status = true } equals new { area_id = area_table.area_id, a_status = area_table.area_status } orderby city_table.city_name ( (city_table.city_name.contains(txt_search_city.text.trim()) || (txt_search_city.text.trim() == "")) ) select new { city_table.city_id, city_table.city_name, city_table.city_status, city_table.city_code, country_table.country_name, area_table.area_name }).tolist(); gv_city.datasource = row_city; gv_city.databind(); gv_city.headerrow.tablesection = tablerowsection.tableheader; } catch (exception ex) { throw ex; } { city_context = null; } }
maybe trim() operation not supported db driver... try removing trim()
Comments
Post a Comment