Nested Query Trouble
Hi, guys. I'm having a slight problem trying to do a nested query in visual basic .net. I'm currently using an SQLDataReader to retrieve the data that the query should be returning. It seems, however, that the query itself is not returning anything because the DataReader gives me an error. Anyway, here is my current query:
sqlGetScheduledEmp =
"SELECT FirstName, LastName
FROM Personnel
WHERE (SNo =
(SELECT SNo FROM PostAssignments WHERE (shiftID = '" & cboShift.Text & "' AND (postID =
(SELECT postID FROM Posts WHERE Unit = '" & txtUnit.Text & "' AND Post='" & cboAssignments.Text & "'))))"
I know the nested query itself works in SQL Server when I hard code the values. I have tried hard coding the values in .net, but I still get an error. Any suggestions would be VERY helpful, as I'm about to pull my hair out! ;)
|