Wednesday, March 7, 2012

going over 2 selects in 1 query

i have a code L

;
conPubs =New SqlConnection(conStr) conPubs.Open()'**>> building select box for ??? ?????? cmdSelect =New SqlCommand("Select * From course_type;SELECT UploadTrail_id, UploadTrail_select_types_id FROM UploadTrail_select_values WHERE (UploadTrail_id = 54) AND (UploadTrail_select_types_id = 6);", conPubs)Dim ReaderAs SqlDataReader Reader = cmdSelect.ExecuteReader() course_type.DataSource = Reader course_type.DataValueField ="course_id" course_type.DataTextField ="course_name" course_type.DataBind()


if u look u will see 2 select's that are delimited with ; (semicolon)
how can i access the second recordset after i bind the first one on the last line
(i want to get values from the rows in the second "select")
thnaks in advance
peleg

for the second part you use

Reader.NextResult()

then as you would do for the first part.

No comments:

Post a Comment