Define An Entity For Selecting Union Set And Intersection Set Applications?
Aug 27, 2010
i have a SearchEntity (SE), which contains following propertes
[Code]....
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)
OR
((age <18) and male and live in LA and chose (answer no.1 or chose answer no.2))
OR
(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?
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.
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,
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).
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) { CompileQuery(); //uses selectUser } public static SomethingElse DoSomethingElse() { CompileQuery(); //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.
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.
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?
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?
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
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 ..in 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.
i have two queries they are: query1: select CustID,NoOfChits from tblCust1 where [Group]='A' and CustID='a001' query2: 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: ---------- Taken 4
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.
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
-----------------------------------------------------------1------------------------------------------ ********View1******* select id, lang, active from table1 union select id,lang,active from table2 ...--same way to all other 15 tables *******SP***********
select top 10 from View1 where active=1 and lang='he' order by id desc
or ********View1******* select id, lang, active from table1 where active=1 and lang='he' union select id,lang,active from table2 where active=1 and lang='he' ...--same way to all other 15 tables *******SP***********
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.
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 A.email = "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:
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.