.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

IndexOutOfRangeExeption How do I do this

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

I've inherited a database with duplicate naming (for example, there's an Item_id field in just about every table). Trying to do joins is a royal pain. Especially since I don't seem to be able to specify WHICH Item_id I want. For example, if there's an Item_id  field in Table1 and an Item_id field in Table2 (sometimes they refer to the same ID, sometimes a different one) and I join with SELECT *, I get an error when I try to get the id's like this:

intItemID = objDataReader("Table2.Item_id")

I get the frustrating "IndexOutOfRangeException" error.  So, How do I specify which one I want?  Am I going to have to go in and do something like:

"SELECT Table1.Item_id AS t1ItemID, Table2.Item_id as t2ItemID..."?


View Complete Post

More Related Resource Links

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend