I'm trying to extract a controls fields value in C#, here is the following code:
public void CTRL128_14_Clicked(object sender, ClickedEventArgs e)
{
//Declare our variables
string fileName;
XPathNavigator nameNode;
//Set the values. Replace "/my:myFields/my:textField" with the xpath to the field that has the value you want as the file name
nameNode = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Counter_Awareness", NamespaceManager);
fileName = nameNode.Value;
string fileName2;
XPathNavigator nameNode2;
//Set the values. Replace "/my:myFields/my:textField" with the xpath to the field that has the value you want as the file name
nameNode2 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:SumAll_Counters1.1", NamespaceManager);
fileName2 = nameNode2.Value;
{
if (fileName >= fileName2)
{
DialogResult result = MessageBox.Show("Awareness is not accompanied by another solution that is implemented, do you still want to submit this form?", "Warning",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
DataConnection spConn =
DataConnections["SharePoint Library Submit"];
spConn.Execute();
Application.ActiveWindow.Close(); // Esto cierra la aplicacion
}
else if (result == DialogResult.No)
{
//code for No
}
}
}
}
It's suppose to compare two values and if filename one is greater then filename2, a messagebox is suppose to appear for the user. I keep getting problems with the operator saying that: "Error 1 Operator '>=' cannot be applied to operands of type 'string' and 'string'. I tried using integer values but no luck.