.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 30th, 2005, 10:10 PM
erikkl2000 erikkl2000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 6 erikkl2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 32 sec
Reputation Power: 0
Need to retrieve resultset from datareader

Hello all,

I am in need to populate a datalist with a compound select querry, I am not retreaving alot of data,, only a couple of fields from three tables,, however, one of the tables i am not able to inner join on.. so i am looking for some help here on how to iteriate through a datareader and pull the two resultsets from the reader and not just one.. from the time that i have spent on this little issue it is apparent that the reader will loop the first result and not notice the second result..

Surely there is a way to retrieve this data so that i can use it in a datalist..

Below is how i would like to implement this with a datalist (to some degree,, this is just a simple example so that i can get some desperately needed help on this)


Looking for all help and ideas here.. i am very much open to all ideas.



=======================================
Here is the SPROC

ALTER procedure Data_Reader


AS



SELECT Employees.LastName



FROM Employees




SELECT Customers.CompanyName
FROM CUSTOMERS
=============================================




This works great with ddls...


Can have 100 table if desired and with little to no code fill all the ddl you want to..


Dim cnn As New SqlConnection("data source = desktop; initial catalog= northwind; trusted_connection=true")
cnn.Open()
'
Dim cmd As New SqlCommand("Data_Reader", cnn)
cmd.CommandType = CommandType.StoredProcedure


Dim dr As SqlDataReader
dr = cmd.ExecuteReader

With ddlLastName
.DataSource = dr
.DataTextField = "LastName"
.DataValueField = "LastName"
.DataBind()
End With

dr.NextResult()
With ddlCompanyName
.DataSource = dr
.DataTextField = "CompanyName"
.DataValueField = "CompanyName"
.DataBind()
End With

cnn.Close()
dr.Close()

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Need to retrieve resultset from datareader


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT