I am trying to see how to format the SQL statement for a button that will query based on another field in my form. I know how to write sql queries normally but the c# is throwing me off. If anyone has any links to examples or tutorials that would be helpful. Thanks.
Here is what Infopath says the sql is on my secondary datasouce I am using when I modify/edit the datasource.
shape
{select "IRid","MonVisitnumber","MonitorID","UnitStatusID","GranteeAgencyCD","DateOfVisit","OccupantName","JobNo","HeatingCon","InsulationCon","AddFundSour","Passed" from "smorris"."InspectionReports" as "InspectionReports"} as "InspectionReports"
append
({select "IRid","LineItemID","ActiontypeID","ActionCOM","ActionHS" from "smorris"."IRHealthSafetyActions" as "IRHealthSafetyActions"}
relate "IRid" TO "IRid") as "IRHealthSafetyActions",
({select "IRid","LineItemID","ActiontypeID","ActionCOM","ActionHS" from "smorris"."IREnergyMeasureActions" as "IREnergyMeasureActions"}
relate "IRid" TO "IRid") as "IREnergyMeasureActions",
({select "IRid","LineItemID","ActiontypeID","ActionCOM","ActionHS" from "smorris"."IRDiagnosticTestsActions" as "IRDiagnosticTestsActions"}
relate "IRid" TO "IRid") as "IRDiagnosticTestsActions",
({select "IRCommentID","IRid","CommentTypeID","CommentText" from "smorris"."IRComments" as "IRComments"}
relate "IRid" TO "IRid") as "IRComments"
and I am trying have that data filtered by
where [IRid] =
" + IRlookup;
This is working if I only use "select * from [InspectionReports] where [IRid] = " + IRlookup;
But I missing half of the data I need.