- public static dynamic GetTaxonomies(int businessUnitId, int memberId, string businessUnitType)
-
{
-
using (var db = new ProtocolManagementDatabaseEntities())
-
{
-
var taxonomies = (from taxonomy in db.taxonomies
-
join businessUnitTaxonomy in db.businessunittaxonomies on taxonomy.taxonomyid equals businessUnitTaxonomy.taxonomyid
-
let TaxonomyID = taxonomy.taxonomyid
-
where businessUnitTaxonomy.businessunitid == businessUnitId
-
select new
-
{
-
TaxonomyId = taxonomy.taxonomyid,
-
TaxonomyName = taxonomy.taxonomyname,
-
preferenceValue = db.userpreferences.Where(x => x.entitycolumnvalue == TaxonomyID &&
-
x.memberid == memberId && x.entitytablename == "Taxonomy" && x.sequencenumber == 5)
-
.Select(x => x.isvisible).FirstOrDefault()
-
-
AppCategory = (from appCategory in db.appcategories
-
join appCategoryTaxonomy in db.appcategorytaxonomies on appCategory.appcategoryid equals appCategoryTaxonomy.appcategoryid
-
let AppCategoryID = appCategory.appcategoryid
-
where appCategory.parentappcategoryid == null &&
-
appCategory.appcategorylevel.Equals("AppCategoryName")
-
&& appCategoryTaxonomy.taxonomyid == TaxonomyID &&
-
appCategoryTaxonomy.businessunitid == businessUnitId
-
-
orderby appCategory.name ascending
-
select new
-
{
-
AppCategoryId = appCategory.appcategoryid,
-
AppCategoryName = appCategory.name,
-
-
AppCategoryDeletionEnable = db.appcategories.Where(x => x.parentappcategoryid == AppCategoryID)
-
.FirstOrDefault() != null ? true : false
-
-
SubCategory = from subCategory in db.appcategories
-
let SubCategoryID = db.appcategories.Where(x => x.appcategoryid == subCategory.appcategoryid).Select(x => x.appcategoryid).FirstOrDefault()
-
where subCategory.parentappcategoryid == AppCategoryID && subCategory.businessunitid == businessUnitId
-
orderby subCategory.name ascending
-
select new
-
{
-
AppCategoryId = subCategory.appcategoryid,
-
AppCategoryName = subCategory.name,
-
Description = subCategory.description,
-
IsGlobal = subCategory.isglobal,
-
IsEnable = subCategory.isenable,
-
ParentAppCategoryID = appCategory.parentappcategoryid,
-
SubCategoryDeleteEnable = db.protocolappcategories.Where(x => x.appcategoryid == SubCategoryID)
-
.FirstOrDefault() != null ? true : false,
-
-
AppCategoryLevel = subCategory.appcategorylevel,
-
IsExpand = false,
-
}
-
}).ToList()
-
}).ToList();
-
return taxonomies;
-
}
-
}
My project has subqueries used inside nested Query.While using a subquery inside the inner query, variable declared in outer query becomes unaccesible to inner queries inside it.
Error found while debugging nested queries:
1. Unknown column 'Join3.appcategoryid' in 'field list'
2. Unknown column 'Extent1.taxonomyid' in 'where clause'
0 971 Sign in to post your reply or Sign up for a free account.
Similar topics
by: sivaram |
last post by:
Hi all,
I have the following query in Visual Foxpro that is throwing error.
UPDATE T1 set T1.C2 = (select T2.C2 from T2 where T1.c1 = T2.C1)
|
by: gkellymail |
last post by:
the following query works fine:
select link.idx, link.x_table, link.x_id_a, link.x_id_z, a.strandid,
b.strandid
from link_detail, link, strand A, strand B
where link_detail.x_table =...
|
by: Dax |
last post by:
Hi,
I have a problema of query in an asp page, if I run the query in sql
query analizer is time running it's about 3-4 seconds, if I made the
same query in an asp page it create the error of...
|
by: santoshsri |
last post by:
Hi below is a SQL Query written at SQL Server 2000. The result has been ordered by a.Location_Number , a.Transaction_Date, but in output the result is not ordered for eg : I am getting records for...
|
by: nico3334 |
last post by:
I currently have a query that Joins 2 Tables (Table1 and Table2) using
LEFT OUTER JOIN. Here is an example of that query:
SELECT a.supply,
a.state,
b.cost
FROM Table1 a
LEFT...
|
by: maxamis4 |
last post by:
I have the following query that I am trying to carry over from ms access to ms sql server. I keep getting a msg 156, level 15, state 1, line 2 Incorrect syntax near the keyword "INNER".
it works...
|
by: acoppini |
last post by:
I am trying to use string variables LIN and Portfolio defined from a recordset recControl in VBA SQL Select Query in Microsoft Access 2003. My syntax must be wrong as I keep getting a Syntax error....
|
by: rush2hem |
last post by:
I am trying to build a query which will give me unique rows. Details:-
Table 1 (F1, F2 are the columns)
F1 F2
1 A1
2 A2
3 A3
4 A4
Table 2 (F3,F4 are the columns)
F3 F4
|
by: abcrf |
last post by:
Trying to run an update query with multiple join statements in VBA, but I keep getting "missing operator" errors. Same happens when I try to run the SQL in query builder. The SQL is:
UPDATE...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |