I have a form that was designed in Infopath 2007.
The form use’s Jscript and works fine but we are upgrading MS Office to 2010
And MS have now taken the Jscript functionality out of IP2010 the from will not run.
So I need to convert the Jscript to C#.
But I’m not a programmer so I am finding it difficult. The script is
// ****************************Code to change the sql Query for Face Days*********************************
var FaceDaysSQL = "";
var FaceDaysSQL1 ="";
// Retrieve the SQL statement of the data source
var FaceDaysSQL = XDocument.DataObjects["Face days"].QueryAdapter.Command;
//Retrieve the field in the InfoPath form whose value will be used in the WHERE clause
var FaceDays =XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Face/@FaceDate");
// Generate the new SQL statement with WHERE clause
FaceDaysSQL1 = FaceDaysSQL + " and FaceDate = '" + FaceDays.text + "'";
// Populate the command with the new SQL statement
XDocument.DataObjects["Face days"].QueryAdapter.Command = FaceDaysSQL1;
// Run the query
XDocument.DataObjects["Face days"].Query();
// change the Query back to orriganl query.
XDocument.DataObjects["Face days"].QueryAdapter.Command = FaceDaysSQL;
any help would be appreciated