Hi ,
what i need to do is have two select statemetns in a stored procedure and display the results in two different listboxes.
the problem i am facing is that its getting all hte records as required but wehn i try the second list box is always empty ( i have the sql in query analyzer )
Is there a way to check whether how many recordsets are returend or how many records are there in each recordset
Need help ...... going nuts
My Stored procedure is as follows
CREATE PROCEDURE [dbo].[spUSER_GetAgents]
@groupid int
AS
SELECT distinct con.AgentNo, c.LastName + ', ' + c.FirstName AS AgentName FROM MPUserGroup con inner join contact c on con.AgentNo = c.ClientNo
WHERE MPGroupID <> @groupid AND con.Agentno NOT IN
(SELECT AgentNo FROM MPUserGroup WHERE MPGroupID= @groupid)
SELECT distinct con.AgentNo, c.LastName + ', ' + c.FirstName AS AgentName FROM MPUserGroup con inner join contact c on con.AgentNo = c.ClientNo WHERE MPGroupID = @groupid
GO
and my asp code is as follows
<td width=285 align=center>
<%
strProc = "spUSER_GetAgents '" & strMarket & "'"
set rs = objWebData.getRS(cstr(conn),strProc,1)
Response.Write "<select name=selAgtAddList id=selAgtList MULTIPLE SIZE=7>"
While not rs.EOF
Response.Write "<option "
Response.Write "value=" & rs.Fields("AgentNo")
Response.Write ">" & rs.Fields("AgentName") & "</option>"
rs.MoveNext
Wend
Response.Write "</select>"
%>
</td>
<td width = 285 align=center>
<%
set rs = rs.NextRecordset
Response.Write "<select name=selAgtRmvList id=selAgtRmvList MULTIPLE SIZE=7>"
While not rs.EOF
Response.Write "<option "
Response.Write "value=" & rs.Fields("AgentNo")
Response.Write ">" & rs.Fields("AgentName") & "</option>"
rs.MoveNext
Wend
Response.Write "</select>"
%>
</td>
what i need to do is have two select statemetns in a stored procedure and display the results in two different listboxes.
the problem i am facing is that its getting all hte records as required but wehn i try the second list box is always empty ( i have the sql in query analyzer )
Is there a way to check whether how many recordsets are returend or how many records are there in each recordset
Need help ...... going nuts
My Stored procedure is as follows
CREATE PROCEDURE [dbo].[spUSER_GetAgents]
@groupid int
AS
SELECT distinct con.AgentNo, c.LastName + ', ' + c.FirstName AS AgentName FROM MPUserGroup con inner join contact c on con.AgentNo = c.ClientNo
WHERE MPGroupID <> @groupid AND con.Agentno NOT IN
(SELECT AgentNo FROM MPUserGroup WHERE MPGroupID= @groupid)
SELECT distinct con.AgentNo, c.LastName + ', ' + c.FirstName AS AgentName FROM MPUserGroup con inner join contact c on con.AgentNo = c.ClientNo WHERE MPGroupID = @groupid
GO
and my asp code is as follows
<td width=285 align=center>
<%
strProc = "spUSER_GetAgents '" & strMarket & "'"
set rs = objWebData.getRS(cstr(conn),strProc,1)
Response.Write "<select name=selAgtAddList id=selAgtList MULTIPLE SIZE=7>"
While not rs.EOF
Response.Write "<option "
Response.Write "value=" & rs.Fields("AgentNo")
Response.Write ">" & rs.Fields("AgentName") & "</option>"
rs.MoveNext
Wend
Response.Write "</select>"
%>
</td>
<td width = 285 align=center>
<%
set rs = rs.NextRecordset
Response.Write "<select name=selAgtRmvList id=selAgtRmvList MULTIPLE SIZE=7>"
While not rs.EOF
Response.Write "<option "
Response.Write "value=" & rs.Fields("AgentNo")
Response.Write ">" & rs.Fields("AgentName") & "</option>"
rs.MoveNext
Wend
Response.Write "</select>"
%>
</td>