G
Guest
C#
I have a DataSet defined in my project that consists of one main table and 3
child tables. I have a SQL statement that can retrieve all the information
for this structure, but how do I populate my dataset in one hit using a
DataAdapter??
I tried to do something liket his:
daRequest.Fill(ResultDataSet.WorkRequest);
daRequest.Fill(ResultDataSet.WorkRequestAction);
daRequest.Fill(ResultDataSet.WorkRequestEffect);
daRequest.Fill(ResultDataSet.WorkRequestNote);
daRequest.Fill(ResultDataSet.Job);
but it fails when it hits the second one as there is not data for that table
for the particular WorkRequest I am dealing with.
My SQL statement looks like this:
SELECT *
FROM WorkRequest LEFT OUTER JOIN
WorkRequestAction ON WorkRequest.WorkRequestObj =
WorkRequestAction.WorkRequestObj LEFT OUTER JOIN
WorkRequestEffect ON WorkRequest.WorkRequestObj =
WorkRequestEffect.WorkRequestObj LEFT OUTER JOIN WorkRequestNote ON
WorkRequest.WorkRequestObj = WorkRequestNote.WorkRequestObj LEFT OUTER JOIN
Job ON WorkRequest.WorkRequestObj = Job.WorkRequestObj
WHERE WorkRequest.WorkRequestObj = " + WorkRequestObj
Am I approaching this from the right way, or cant you do this kind of thing
with a DataAdapter?
Thanks
Steve
I have a DataSet defined in my project that consists of one main table and 3
child tables. I have a SQL statement that can retrieve all the information
for this structure, but how do I populate my dataset in one hit using a
DataAdapter??
I tried to do something liket his:
daRequest.Fill(ResultDataSet.WorkRequest);
daRequest.Fill(ResultDataSet.WorkRequestAction);
daRequest.Fill(ResultDataSet.WorkRequestEffect);
daRequest.Fill(ResultDataSet.WorkRequestNote);
daRequest.Fill(ResultDataSet.Job);
but it fails when it hits the second one as there is not data for that table
for the particular WorkRequest I am dealing with.
My SQL statement looks like this:
SELECT *
FROM WorkRequest LEFT OUTER JOIN
WorkRequestAction ON WorkRequest.WorkRequestObj =
WorkRequestAction.WorkRequestObj LEFT OUTER JOIN
WorkRequestEffect ON WorkRequest.WorkRequestObj =
WorkRequestEffect.WorkRequestObj LEFT OUTER JOIN WorkRequestNote ON
WorkRequest.WorkRequestObj = WorkRequestNote.WorkRequestObj LEFT OUTER JOIN
Job ON WorkRequest.WorkRequestObj = Job.WorkRequestObj
WHERE WorkRequest.WorkRequestObj = " + WorkRequestObj
Am I approaching this from the right way, or cant you do this kind of thing
with a DataAdapter?
Thanks
Steve