Corsegrerge
New Member
How do u add 2 tables to a Dataset?<BR><BR>ThnxHi,<BR> I've not tried it.But u can try this one.<BR><BR>myCommand.Fill(dataset1,"table1")<BR>myCommand.Fill(dataset1,"table2")<BR><BR>To retrieve it <BR>ds1.Tables("table1")<BR>ds1.Tables("table2")<BR>You can use a SQL Join statement if you are matching up ID's.<BR>For example.<BR><BR>tblStaff<BR>---------<BR>iStaffID<BR>vFirstName<BR>vLastName<BR>iRoleID<BR><BR>tblRoles<BR>--------<BR>iRoleID<BR>vRoleName<BR><BR>And I want all the first and last name and the role name (not just the id)<BR><BR>Then you would have a SQL statement like this:<BR><BR>select vFirstName, vLastName, vRoleName from tblStaff S inner join tblRoles R where S.iRoleID = R.iRoleID <BR><BR>I'm not sure if this is what you mean, but I hope this helps!