Will a strongly typed dataset not fill the problem with table mappings? C # .net 2.0

You were excellent with my other questions before - so here I go again, I need some help!

I have a query that joins three tables and a strongly typed dataset that has columns defined for everything that is returned from the query. When I go to fill in the dataadapter, nothing is filled. I copied the code from another method, so I assume that everything is in order - the only difference is that this request has connections. Any help is appreciated, the code should be:

Query:

select gsh.locid, locations.description, GSH.workorder, GSH.comstatus, GSH.teststatus, GSH.fireresult, GSH.lightresult, GSH.watercold, GSH.waterhot, GSH.responsedate, GSH.comments, GSH.testername from gsh_vhs_locations locs left outer join locations on locs.maximoloc = locations.location left outer join gsh_vhs_comms GSH on locs.LOCID = GSH.locid where gsh.insertdate > sysdate-7 order by locid, locations.description, GSH.workorder, GSH.comstatus, GSH.teststatus, GSH.fireresult, GSH.lightresult, GSH.watercold, GSH.waterhot, GSH.responsedate, GSH.comments, GSH.testername

Code:

ResponseSheet Tests = new ResponseSheet();
        DataSet ReturData = new DataSet();
        OracleDataAdapter da;
        try
        {
            using (OracleConnection conn = new OracleConnection(ConnString))
            {
                conn.Open();

                OracleCommand cmd = new OracleCommand();
                cmd.Connection = conn;
    cmd.CommandText = @"select gsh.locid, locations.description, GSH.workorder, GSH.comstatus,      GSH.teststatus, GSH.fireresult, GSH.lightresult, GSH.watercold, GSH.waterhot, GSH.responsedate,     GSH.comments, GSH.testername 
from gsh_vhs_locations locs
left outer join locations on locs.maximoloc = locations.location
left outer join gsh_vhs_comms GSH on locs.LOCID = GSH.locid 
where gsh.insertdate > sysdate-7
order by locid, locations.description, GSH.workorder, GSH.comstatus, GSH.teststatus, GSH.fireresult,        GSH.lightresult, GSH.watercold, GSH.waterhot, GSH.responsedate, GSH.comments, GSH.testername ";

                da = new OracleDataAdapter(cmd.CommandText, conn);

da.MissingMappingAction = MissingMappingAction.Error;
da.TableMappings.Add("Table", "ResponseSheet");
                da.Fill(ReturData, "ResponseSheet");

            }

        }
        catch (Exception ex)
        {
            Console.WriteLine(TimeStamp() + ex.Message.ToString() + "Get Capture Report (TraceCode: 00019)");
        }


        return ReturData;
    }

As you can see, I turned on the error report for table comparisons, but at runtime I get no errors, just an empty dataset (da = null)

-, , Google , - :)

+3
5

,

.

, - TNSnames ( )

, .

, .

, , (joins arent right, ).

,

: , ( , -, !), :

da.MissingMappingAction = MissingMappingAction.Passthrough; da.MissingSchemaAction = MissingSchemaAction.Add;

, .

0
+1

conn.Open() .Fill() . . , , .

, OracleCommand, . Command.

+1

, - locid gsh_vhs_comms, insertdate > sysdate-7 , , . , . , - , .

+1

, ?

+1

Source: https://habr.com/ru/post/1713676/


All Articles