Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2003, 08:36 PM
Authorized User
 
Join Date: Aug 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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! ;)

 
Old December 23rd, 2003, 05:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Cross post. Please see here: http://p2p.wrox.com/topic.asp?TOPIC_ID=7897 for any replies.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested query deb1980 ASP.NET 2.0 Basics 2 April 10th, 2007 04:38 AM
Nested Query teclo MySQL 1 March 22nd, 2005 07:20 AM
Nested Query BrianWren Oracle 5 February 1st, 2005 01:45 PM
nested insert query/...how? mch SQL Server 2000 2 April 28th, 2004 08:46 AM
Nested Query Trouble ashley_y ADO.NET 2 December 23rd, 2003 01:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.