1 Replies - 782 Views - Last Post: 18 June 2012 - 04:47 AM Rate Topic: -----

#1 RainbowInTheDark   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 05-June 12

QUESTION: Inner join table not display data

Posted 06 June 2012 - 07:38 AM

Hi there, I'd wanna know what is wrong with the code because the inner join is nt displaying the current user's details in web browser.

SqlCommand cmd = new SqlCommand("SELECT a.Stu_Name,a.Stu_Password,a.Stu_IC,a.Stu_Contact,a.Stu_Gender,a.Stu_Email,a.Stu_Address,a.Stu_Height,a.Stu_Weight,a.Stu_PEmail,a.Stu_ClassName,ISNULL(150 - b.Stu_DemeritPoints, 150) AS Expr1 FROM Student AS a INNER JOIN DemeritPoints AS b ON a.Stu_Name=b.Stu_Name WHERE a.Stu_Name = '" + HttpContext.Current.User.Identity.Name + "' ", connection);



Is This A Good Question/Topic? 0
  • +

Replies To: QUESTION: Inner join table not display data

#2 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1534
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: QUESTION: Inner join table not display data

Posted 18 June 2012 - 04:47 AM

Are you using Windows Authentication? If so, HttpContext.Current.User.Identity.Name will give you domain\username. You will need to make sure that the value in Stu_Name is also domain\username.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1