Hello, I am quite new in infopath development and development in general. I have a simple form template with code behind (C#). It works fine in preview.
When I do a verify before upload to Sharepoint I got a few errors :
here is a part of my code :
using Microsoft.Office.InfoPath;
using System;
using System.Xml;
using System.Xml.XPath;
using System.Data.SqlClient;
namespace GetUserInformation
{
public partial class FormCode
{
public string CurrentUserName;
public string CurrentDomainName;
// Member variables are not supported in browser-enabled forms.
// Instead, write and read these values from the FormState
// dictionary using code such as the following:
//
// private object _memberVariable
// {
// get
// {
// return FormState["_memberVariable"];
// }
// set
// {
// FormState["_memberVariable"] = value;
// }
// }
...
I then get the domain and current user name in the declared variables. The commented code says what the error will be and how to cope with it, but I don't know how to handle this.
Can anybody help me out please ?
OTHER Question : by using Formstate, will my form still work in Infopath ???
Thanks