Click here to Skip to main content
15,888,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Error on System.Web.Helpers.WebMail.Send() method in TFS 2012 Pin
Bernhard Hiller19-Mar-14 23:40
Bernhard Hiller19-Mar-14 23:40 
GeneralRe: Error on System.Web.Helpers.WebMail.Send() method in TFS 2012 Pin
trevor1520-Mar-14 0:09
trevor1520-Mar-14 0:09 
QuestionHow to scroll all rows inside datagrid ? Pin
ngoloi19-Mar-14 5:11
ngoloi19-Mar-14 5:11 
AnswerRe: How to scroll all rows inside datagrid ? Pin
_AK_19-Mar-14 5:42
_AK_19-Mar-14 5:42 
GeneralRe: How to scroll all rows inside datagrid ? Pin
ngoloi19-Mar-14 22:39
ngoloi19-Mar-14 22:39 
QuestionIf record doesn't in one table, check another,how? Pin
samflex18-Mar-14 8:01
samflex18-Mar-14 8:01 
SuggestionRe: If record doesn't in one table, check another,how? Pin
Richard Deeming18-Mar-14 8:41
mveRichard Deeming18-Mar-14 8:41 
AnswerRe: If record doesn't in one table, check another,how? Pin
Arun Radhakrishnan18-Mar-14 9:38
Arun Radhakrishnan18-Mar-14 9:38 
Hi,

I tried with your query. it's working fine for me.


Table Structure

SQL
CREATE TABLE [dbo].[employees] (
    [Id]       INT           NOT NULL,
    [username] NVARCHAR (50) NULL,
    [ssn]      NCHAR (10)    NULL,
    [password] NCHAR (10)    NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


SQL
CREATE TABLE [dbo].[members] (
    [Id]       INT           NOT NULL,
    [username] NVARCHAR (50) NULL,
    [ssn]      NCHAR (10)    NULL,
    [password] NVARCHAR (50) NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


Data

Members Table

SQL
INSERT INTO [dbo].[members] ([Id], [username], [ssn], [password]) VALUES (1, N'name3', N'123456700 ', N'pass3')
INSERT INTO [dbo].[members] ([Id], [username], [ssn], [password]) VALUES (2, N'nameOne', N'123456789 ', N'passOne')
INSERT INTO [dbo].[members] ([Id], [username], [ssn], [password]) VALUES (3, N'nameTwo', N'987654321 ', N'passTwo')



Employees Table

SQL
INSERT INTO [dbo].[employees] ([Id], [username], [ssn], [password]) VALUES (1, N'name1', N'123456789 ', N'pass1     ')
INSERT INTO [dbo].[employees] ([Id], [username], [ssn], [password]) VALUES (2, N'name2', N'987654321 ', N'pass2     ')



SQL

SELECT count(*)
FROM employees e JOIN members r ON e.ssn = r.ssn
WHERE (e.username='name1' AND e.ssn = '123456789')
OR (r.username='name1' AND r.ssn = '123456789')


If possible can you share your table data and structure ?
JokeRe: If record doesn't in one table, check another,how? Pin
Deflinek18-Mar-14 10:14
Deflinek18-Mar-14 10:14 
QuestionSession Lost Pin
Zeyad Jalil18-Mar-14 1:35
professionalZeyad Jalil18-Mar-14 1:35 
AnswerRe: Session Lost Pin
kaushikpathak18-Mar-14 1:50
kaushikpathak18-Mar-14 1:50 
GeneralRe: Session Lost Pin
RichardGrimmer9-Apr-14 4:47
RichardGrimmer9-Apr-14 4:47 
AnswerRe: Session Lost Pin
Zeyad Jalil18-Mar-14 22:06
professionalZeyad Jalil18-Mar-14 22:06 
QuestionSession be Null in ASP.Net Web Application Pin
Zeyad Jalil17-Mar-14 21:00
professionalZeyad Jalil17-Mar-14 21:00 
QuestionAsp.net DropDownList Data Function Pin
LouisTan2s17-Mar-14 16:31
LouisTan2s17-Mar-14 16:31 
SuggestionRe: Asp.net DropDownList Data Function Pin
Himanshu Jain17-Mar-14 17:24
Himanshu Jain17-Mar-14 17:24 
AnswerRe: Asp.net DropDownList Data Function Pin
Chris Quinn17-Mar-14 22:23
Chris Quinn17-Mar-14 22:23 
QuestionRedirect to web form from web service Pin
Ngan Tran17-Mar-14 6:38
Ngan Tran17-Mar-14 6:38 
AnswerRe: Redirect to web form from web service Pin
#realJSOP17-Mar-14 8:46
mve#realJSOP17-Mar-14 8:46 
AnswerRe: Redirect to web form from web service Pin
Dave Kreskowiak17-Mar-14 9:02
mveDave Kreskowiak17-Mar-14 9:02 
QuestionDropList doesn't post back Pin
#realJSOP17-Mar-14 5:11
mve#realJSOP17-Mar-14 5:11 
AnswerRe: DropList doesn't post back Pin
#realJSOP18-Mar-14 10:53
mve#realJSOP18-Mar-14 10:53 
QuestionHow to assign role to linq queries? Pin
miss78617-Mar-14 1:36
miss78617-Mar-14 1:36 
AnswerRe: How to assign role to linq queries? Pin
kaushikpathak18-Mar-14 1:26
kaushikpathak18-Mar-14 1:26 
GeneralRe: How to assign role to linq queries? Pin
miss78618-Mar-14 1:51
miss78618-Mar-14 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.