View Single Post
  #2 (permalink)  
Old April 10th, 2010, 10:30 AM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

Hi SG,
Boo datasets >< Anyway the reason you are getting the error is because BuyersAgent DOESN'T Table 1 of your dataset as evident by this line:

vb Code:
BuyersAgent = DirectCast(dataSet.Tables(1).Rows(0).ItemArray(1), String)

And that is the problem, you are binding your gridview to Table1 although implictly.

Now your code is going to get messy on the UI side trying to bind data from two tables and off the top of my head I am not sure how you would do it but this post should set you in the right direction:

IMHO I think you probably get this down to a single table by doing some sort of a JOIN, of course I am just making the assumption since I have no idea what you sproc looks like or your data model for that matter.

Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."