Question : How do I join multiple tables using IDataReader

When going from a simple one table select to joining a second table I am unable to read any data from my record set using IDataReader. I know the select statement works because it works in SQL SMS.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
//this works
            using (SqlConnection dbconn = DB.dbConn())
           
            {
                dbconn.Open();
               
                using (IDataReader rs = DB.GetRS("select P.* from Product P   where P.ProductID=3", dbconn))
 
//this does not work
 
            using (SqlConnection dbconn = DB.dbConn())
           
            {
                dbconn.Open();
               
                using (IDataReader rs = DB.GetRS("select P.*, pm.name from Product P join productmanufacturer pm on p.productid = pm.productid  where P.ProductID=3", dbconn))

Answer : How do I join multiple tables using IDataReader

Perhaps there are no table matches between the 2 joined tables? I would also try using INNER JOIN instead of just JOIN, they are basically the same anyway.
Random Solutions  
 
programming4us programming4us