I am used to creating a data set with data from one table, for instance:
Code:Dim da As New OdbcDataAdapter("SELECT WORKORDER.WONUM, WORKORDER.DESCRIPTION, WORKORDER.WORKTYPE, WORKORDER.SUPERVISOR, WORKORDER.REPORTEDBY FROM DB1.WORKORDER WHERE WORKORDER.WONUM=?", conn) Dim ds As New DataSet da.SelectCommand.Parameters.Add("@WONUM", OdbcType.VarChar, 1000).Value = Me.workOrderNumberTB.Text.ToString da.Fill(ds, "WORKORDER")
Now I am needing to add a second table. For instance, my second table "EQUIPMENT" has a field called "DESCRIPTION" that I would like to add to my dataset. The "WORKORDER" table has a field called "EQNUM" which is what the "EQUIPMENT" table uses as the primary key. Can anyone help me on how to combine these into one dataset?




Reply With Quote