I am having the above problem in my code. I have searched the forum and have read the different ways of getting this to go away with no success. I am extremely new to infopath and .net. I am familiar with VB but not C#, unfortuanelty most examples are in C# so im trying to learn. Any help would be much appreciated. Thanks.
public void CTRL60_4_Clicked(object sender, ClickedEventArgs e) {
// get the value of the DOM node that we’ll use to append to the WHERE clausecurrentElementID = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:_08-Estimate_tbl/@Cost_Center").text;
// get the value of the DOM node that we’ll use to append to the WHERE clausecurrentElementID = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:_08-Estimate_tbl/@Cost_Center").text;
// get the data adapter object myDataAdapter = XDocument.DataAdapters("Actuals"); // set the SQL command property of the data adapter, providing a dynamic WHERE clause
// set the SQL command property of the data adapter, providing a dynamic WHERE clause
myDataAdapter.Command = "SELECT DISTINCTROW Job Number as Job_Number, Cost Center as Cost_Center, Year, Month-Year, Sum(Actual Labor Costs) AS Sum_Of_Actual_Labor_Costs, Sum(Actual Non-Labor Costs) AS Sum_Of_Actual_Non-Labor_Costs, Sum(Total Actual Costs) AS Sum_Of_Total_Actual_Costs FROM actuals GROUP BY Job Number, Cost Center, Year, Month-Year";
// execute the query myDataAdapter.Query();
}
myDataAdapter.Query();
}
// execute the query myDataAdapter.Query();
}
Errors are:
Error 1 The name 'currentElementID' does not exist in the current context \My Documents\InfoPath Projects\SO Admin v91\FormCode.cs 38 13 SO Admin v9
Error 2 The name 'XDocument' does not exist in the current context \My Documents\InfoPath Projects\SO Admin v91\FormCode.cs 38 32 SO Admin v9
Error 3 The name 'myDataAdapter' does not exist in the current context \My Documents\InfoPath Projects\SO Admin v91\FormCode.cs 41 13 SO Admin v9
Error 4 The name 'XDocument' does not exist in the current context \My Documents\InfoPath Projects\SO Admin v91\FormCode.cs 41 29 SO Admin v9
Error 5 The name 'myDataAdapter' does not exist in the current context \My Documents\InfoPath Projects\SO Admin v91\FormCode.cs 45 13 SO Admin v9
Error 6 The name 'myDataAdapter' does not exist in the current context \My Documents\InfoPath Projects\SO Admin v91\FormCode.cs 48 13 SO Admin v9