Request Failed Infopath Form
Hi All, My requirment is to save infopath form values to sharepoint list. I have created form and button for coding Code public void CTRL11_5_Clicked(object sender, ClickedEventArgs e) { // Write your code here. try { XPathNavigator root = this.MainDataSource.CreateNavigator(); string EmpID = root.SelectSingleNode(("/my:myFields/my:txtEmpID", NamespaceManager).Value; string EmpName = root.SelectSingleNode("/my:myFields/my:txtEmpName", NamespaceManager).Value; string EmpDesignation = root.SelectSingleNode("/my:myFields/my:ddlEmpDesignation", NamespaceManager).Value; string EmpReportingTo = root.SelectSingleNode("/my:myFields/my:ddlEMPReportingTo", NamespaceManager).Value; string EmpJoiningDate = root.SelectSingleNode("/my:myFields/my:dtpEmpJoiningDate", NamespaceManager).Value; string EmpDOB = root.SelectSingleNode("/my:myFields/my:dtpEmpDOB", NamespaceManager).Value; string EmpTeam = root.SelectSingleNode("/my:myFields/my:ddlEmpTeam", NamespaceManager).Value; string EmpClientEngagement = root.SelectSingleNode("/my:myFields/my:ddlEmpClientEngagement", NamespaceManager).Value; string EmpLHFormat = root.SelectSingleNode("/my:myFields/my:rbtnEmpReceivedLHFormat", NamespaceManager).Value; string ListID = root.SelectSingleNode("/my:myFields/my:ListID", NamespaceManager).Value; DataSource dsEmployeeDirectoryVSTA = this.DataSources["EmployeeDirectoryVSTA"]; XPathNavigator batch = dsEmployeeDirectoryVSTA.CreateNavigator(); batch.SelectSingleNode("/Batch/Method/Field[@Name='Title']", NamespaceManager).SetValue(EmpID); batch.SelectSingleNode("/Batch/Method/Field[@Name='EmployeeName']", NamespaceManager).SetValue(EmpName); batch.SelectSingleNode("/Batch/Method/Field[@Name='Designation']", NamespaceManager).SetValue(EmpDesignation); batch.SelectSingleNode("/Batch/Method/Field[@Name='ReportingTo']", NamespaceManager).SetValue(EmpReportingTo); batch.SelectSingleNode("/Batch/Method/Field[@Name='JoiningDate']", NamespaceManager).SetValue(EmpJoiningDate); batch.SelectSingleNode("/Batch/Method/Field[@Name='DOB']", NamespaceManager).SetValue(EmpDOB); batch.SelectSingleNode("/Batch/Method/Field[@Name='Team']", NamespaceManager).SetValue(EmpTeam); batch.SelectSingleNode("/Batch/Method/Field[@Name='CurrentEngagement']", NamespaceManager).SetValue(EmpClientEngagement); batch.SelectSingleNode("/Batch/Method/Field[@Name='ReceivedLHFormat']", NamespaceManager).SetValue(EmpLHFormat); DataConnection dc = this.DataConnections["Web Service Submit"]; dc.Execute(); } catch (Exception ex) { ex.Message.ToString(); } } when i run this code it gives me "Error: Request failed." though every thing is correct. can any one help me to resolve this issue. Thanks in AdvanceMohammed
November 10th, 2010 8:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics