Define An Entity For Selecting Union Set And Intersection Set Applications?

Aug 27, 2010

i have a SearchEntity (SE), which contains following propertes


What i want to do is to pass this entity to the services and return how many ppl has been selected, but i was a bit confused about how to solve the union and intersection issues among each parameters( ex.1) and SEs themselves(ex.2). for example the following scenarios,

1. what if i want to select ppl who ( age>20 and female ) or (who live in LA and (chose answer no.1 or answer no.2))

2. what if to select ppl who ((age <20 or age >60) and female and live in LA and chose answer no.1)


((age <18) and male and live in LA and chose (answer no.1 or chose answer no.2))


(age>65 and live in NY)

in brief, could anyone tell me how to re-design my SE entity so i can handle all the possible scenarios in terms of selecting union and intersection and subset issues?

View 3 Replies

Similar Messages:

Forms Data Controls :: (Grid View Union Gridview) - (Gridview Intersection Gridview) - Avoiding The Duplicates

Jul 19, 2010

I have two gridviews, say 'A' and 'B'...I want to add all the rows of 'A' to 'B' while avoiding the duplicates....For eg:

View 10 Replies

SQL Server :: Selecting Data From Multiple Tables Whilst Using A Union Statement?

Nov 29, 2010

I basically have a series of tables from one database that have an identical structure thus making retrieval of all records fairly easy (I just use a UNION ALL statement). However I need a list of values from another table within a different database that contains information regarding the group of the data.

I so far have the following:

SELECT Table1.* FROM Table1 UNION ALL SELECT Table2.* FROM Table2 UNION ALL SELECT Table3.* FROM Table3 UNION SELECT Database.dbo.SRFILE.SR_GROUP FROM Database.dbo.SRFILE INNER JOIN Database.dbo.SRFILE.SRONUMBER = Table1.Incidentx

I keep receiving a unable to parse message however all I need to retreive is the SR_GROUP value but just don't know the correct syntax. Is it actually possible to do this as the structure of SRFILE is not the same as Table1/2/3.

View 3 Replies

How To: Define Routes For Web Forms Applications

May 26, 2010

I'm reading about URL routing at How to: Define Routes for Web Forms Applications and there's something in the example I don't understand. If you look at the example provided below,

routes.MapPageRoute("", "SalesReport/{locale}/{year}/{*queryvalues}", "~/sales.aspx");

View 1 Replies

ADO.NET :: Selecting Coulmns From 2 Tables Using Entity Framework?

Aug 19, 2010

I have two tabels as mentioned below. I am using entity framework and vs2010.I am not able to write linq query to get data from both the tables. there is one to many relationship(for one category ther can be multiple articles).

View 1 Replies

Entity Framework - Is Using Public Static Variables For Compiled Queries Bad In Applications?

Aug 19, 2010

I'm coding a business layer for an ASP.NET application. I've created database methods in my BLL as static. I've created public static Func variables to be compiled and used in several different methods, like this:

namespace BLL
public class User
public static Func<Context, variable, result> selectUser;
private static void CompileQuery()
if(selectUser == null)
selectUser = CompiledQuery.Compile......
public static UserClass Select(int id)
//uses selectUser
public static SomethingElse DoSomethingElse()
//also uses selectUser

It'll be used in ASP.NET layer like this: using BLL;

private void AddUser()
UserClass user = User.Select(id);

My question is, since static variables are not thread-safe, is this a bad design decision? I'm thinking of either implementing a locking mechanism, which makes me think if it'd slow down the application, or using instantiated class approach which makes me wonder if query compiling would be beneficial.

View 1 Replies

Visual Studio :: Missing ADO.NET Entity Data Model Template In MVC 2 Applications?

Jun 10, 2010

I've been using VS2010 to look at the new ASP.NET and specifically MVC 2. I have gone through the 0.8 release of the MvcMusicStore sample on CodeProject (good job so far).

Now, I'm working on a project to explore MVC more deeply and after creating a table in a local SQL table, I went to create an ADO.NET entity data model to work with the table data. When I get to the list of templates, the total list of templates are:

SQL Server Database Text File XML File XML Schema That's everything (meaning when C# is selected at the top of the dialog's installed templates).

I've re-installed VS2010 (gone through the control panel and the maintenance option for VS2010). There's no Linq, Data Set, Database Unit Test, nothing....

It was there before, it's not now.

UPDATE : I did find this article: [URL] I did run devenv /installvstemplates. It ran without errors, however, the error still persists.

The article said if the "solution" was not a real solution, to re-install VS2010 (Really???). So I went to do so. The ADO.NET entity object framework is installed.

Why would VS2010 "forget" something so intrinsic?

View 1 Replies

WCF / ASMX :: Building Services To Work With Web Applications And Console Applications?

Jun 7, 2010

I've been worked with web services so far, and I'm interested in expanding my services to console applications as well so I started digging up with WCF but I'm conserned that I won't be able to use the HttpContext collection that I've been used to do with web services one important thing which is to generate a random value from HttpContext.Current.Request.ServerVariables["ALL_HTTP"] that I need to reckon if it's the same or at least near what machine that is calling my service. How can I overcome this problem?

I need to know what machine is calling to count the number of attempts to login into my system for example. So must do it inside of the svc code otherwise if I let the client inform what ip address or what computer he is using, anyone could forge this argument and surpass by another machine. May be I'm approaching this matter wrongly. And I should count the number of attempts per state session, but how is it done?

View 1 Replies

Entity Framework -Update Entity When Another Entity Is Updated

Jun 30, 2010

I have an EDM, it includes the entities extension and history. My goal is to use history to keep track of all the changes made to extension entity. For example, if extension with ID 223 has its property 'Name_Display' changed - I want the history entity to record this.

I'm using ASP.NET with VB.NET. Where in my code do I put the hook to say, "update the history entity" and what should that hook look like?

View 1 Replies

ADO.NET :: How To Use Linq Query Union

Aug 31, 2010

I need to use Union for below Linq queries. I could use Union it if it was simple "select new whith{" but Now that I Specified Class, I encounter Error using union


View 3 Replies

Configuration :: Deploying Web Applications With Sub Web Applications?

Apr 22, 2010

Our corporate intranet is designed so that each web application is a child application in the primary application.. Everything has worked fine with Visual Studio 2008 and even in 2010 running the website locally works great, the output directory for the child apps is and the ProjectName.dll copies to that directory.. When I do a publish however it does not and I have to manually copy the dll from the bin folder in the project folder to the parent bin folder, this isn't hard of course but more of a pain in the butt each time I need to publish something. I made sure the output directory is correct for both debug and release yet on publish is just copies it to the child bin and not the parent bin as needed.

View 2 Replies

SQL Server :: How To Union Two Queries Without Duplicates

Aug 27, 2010

I have a sql query that returns 4 columns CustName CustId CustZip CustPhone

I have a second sql query that returns the following 5 columns

CustName CustId CustZip CustEmail CustAddress

Both queries, query different data tables in the database, but return columns that are common to


How do I union the two queries(Assuming a union is needed)

Which will result in no duplicates and an end result being the following output:

CustName CustId CustZip CustPhone CustEmail CustAddress

As you can see we want to not have duplicate values on output. So something like the following
is not acceptable:

Jeff Stamper 2222234 81224 498-300-2222
Jeff Stamper 2222234 81224 498-300-2222 122 Mars Blvd
Karen Bops 3322234 81666 498-300-2222
Karen Bops 3322234 81666 498-300-2222 322 Jamer Road

View 4 Replies

SQL Server :: Order By In Combination With Union?

Aug 24, 2010

How can I order this by count? so if it appears above and below the union statement, I want it on top


View 3 Replies

DataSource Controls :: Why We Need Union Query

Jun 10, 2010

if there is no relation bettwenn two tables why do i need union for example like below Please
can u inform me

SELECT categoryId
FROM categories
SELECT shipperId
FROM shippers

View 3 Replies

ADO.NET :: SqlCommand Union Or Merge With Different SqlConnections?

Nov 7, 2010

how to union or merge the two SqlCommands below?


View 16 Replies

SQL Server ::set Condition With Union All Commands?

Mar 25, 2011

Below is my SQL query in which I have used UNION All In my outer I want to select data onwards particulardate. [code]...

View 1 Replies

DataSource Controls :: Join Query Or Union?

Jun 30, 2010

i have two queries they are:
select CustID,NoOfChits from tblCust1 where [Group]='A' and CustID='a001'
select count(TKCustID) as Taken from tblAuctionGroup where [Group]='A' and TKCustID='a001'

Results of 1st query was:
CustID NoOfChits
a001 2

Results of 2nd query was:

But i want to like below:
CustID NoOfChits Taken
a001 2 4

in the above queries, 1st query displayed two columns and 2nd query displayed one column. but i would like to append the both results in single table or single record, i mean all results should be in same row in same result.

View 3 Replies

DataSource Controls :: Make Union Query Better?

Apr 11, 2010

in my application i should make an union query thay union 15 tables

and this query begin with 150000 rows and will grow .

i need get just 10 rows from this query

i want make this query as best as possible

2 qustion

select id, lang, active from table1
select id,lang,active from table2
...--same way to all other 15 tables

select top 10 from View1 where active=1 and lang='he' order by id desc

select id, lang, active from table1 where active=1 and lang='he'
select id,lang,active from table2 where active=1 and lang='he'
...--same way to all other 15 tables

select top 10 from View1 order by id desc


becauseof that this query is very complicate i want to know if i need take just 10 from each table


if there is an idea how make this query better, i will glad to know.

View 7 Replies

DataSource Controls :: How To Sort The Records When Using Union

Apr 8, 2010

how to sort the records when using union

View 2 Replies

SQL Server :: Can Combine Resultset Return By Union

Sep 30, 2010

Is there a way to row two and three of the result set be returned so that the

following query:


View 10 Replies

SQL Server :: Simple Union Query / From Northwind Database

Aug 4, 2010

I am a .net developer.I am not that strong in SQL.I need a simple query.This is from Northwind Database.

select 'Select All' as CustomerID,'Select All' as City union(select CustomerID, City from Customers
order by City)

i need to get output like 1st row should be Select ALl Select All and next rows should be output of this stat..(select CustomerID, City from Customers order by City)

i am not getting this...i can do by keeping the second query result in temp table and then using union... but i am looking without temp tables or simple query.

View 2 Replies

C# - All Queries Combined Using A UNION, INTERSECT Operator Must Have An Equal Number?

Jan 7, 2010

I have a linq to sql query where I have to perform union two set of records.

And I do not have equal number of fields, so added the null

eg my psuedo code is


after googling some hours I came to understand that it is bug in 3.5 framework.

Now I want to retrieve the result.

How do I do thatI tried framing into two seperate iqueryable

var a= first query

var b =second query

ilist result =a.union b

This too results in the same error.

View 3 Replies

DataSource Controls :: Not Getting The Expect Result Set From Query / Join Or Union?

Jan 27, 2010

i have a form that my i use to look up whether or not there is an email address in the database. i wrote a query with this basic structure:

select *

from table A, table B

where table = "email" or table b = "email"

i though that would return all instances that the email occurred in either table. what i am getting back is a bunch of null or other unrelated records from table A with a matching email in table B. the thing is, these two tables primary key to join them. i thought i wouldnt need to do that though in this case.

here is the actually query i am using if it makes things more clear:

select lm.cemailaddr, lm.b1emailadd, b.emailaddr

View 4 Replies

C# - LINQ Union With BIT Column Causing Specified Cast Is Not Valid Error?

Mar 8, 2011

I have a complicated join between a few tables but I have managed to replicate the error using linqpad and the small tables below. There are references between the COLNAME column and the YAXIS column and also between COLNAME and XAXIS that is not explicitly defined.

The error is "Specified cast is not valid", which originally I wasted time thinking the problem was converting the data returned to my object in VS 2010, but the error also happens in linqpad with no defined object. It seems insane that a bit column would cause this problem. If I change the column type to a VARCHAR it works fine. If I run the generated SQL from linqpad or sql profiler that also returns fine.


View 1 Replies

DataSource Controls :: SQL Select Union And Total Number Of Returned Rows?

May 1, 2010

SQL Select Union and total number of returned rows?

View 3 Replies

Copyrights 2005-15, All rights reserved