S
steve
I need to translate the C# (below) to VB.(this is related to my longer
post from Friday).
So far i can't get past the first line. I tried adding the following
to the OnLoad event of my project:
(i also added these imports)
Imports System.Xml
Imports System.Xml.XPath
Dim myNav As XPathNavigator = MainDataSource.CreateNavigator()
which doesn't compile because MainDataSource is undefined, which makes
sense, since it's not.
My question: what is MainDataSource? Where does it come from?
thanks!
code is from site:
http://enterprise-solutions.swits.n...m-sharepoint-calendar-infopath&c=infopath2007
XPathNavigator root = MainDataSource.CreateNavigator();
// Retrieve the values for the calendar item
string title = root.SelectSingleNode("my:myFields/my:title",
NamespaceManager).Value;
string location = root.SelectSingleNode("my:myFields/my:location",
NamespaceManager).Value;
string startDate = root.SelectSingleNode("my:myFields/my:startDate",
NamespaceManager).Value;
string startTime = root.SelectSingleNode("my:myFields/my:startTime",
NamespaceManager).Value;
string endDate = root.SelectSingleNode("my:myFields/my:endDate",
NamespaceManager).Value;
string endTime = root.SelectSingleNode("my:myFields/my:endTime",
NamespaceManager).Value;
XPathNavigator batch = DataSources["EventCAML"].CreateNavigator();
// Set the title
batch.SelectSingleNode("/Batch/Method/Field[@Name='Title']",
NamespaceManager).SetValue(title);
// Set the location
batch.SelectSingleNode("/Batch/Method/Field[@Name='Location']",
NamespaceManager).SetValue(location);
// Set the start date
batch.SelectSingleNode("/Batch/Method/Field[@Name='EventDate']",
NamespaceManager).SetValue(string.Format("{0}T{1}Z", startDate,
startTime));
// Set the end date
batch.SelectSingleNode("/Batch/Method/Field[@Name='EndDate']",
NamespaceManager).SetValue(string.Format("{0}T{1}Z", endDate,
endTime));
// Submit the item details to the web service to update the calendar
DataConnections["Web Service Submit"].Execute();
post from Friday).
So far i can't get past the first line. I tried adding the following
to the OnLoad event of my project:
(i also added these imports)
Imports System.Xml
Imports System.Xml.XPath
Dim myNav As XPathNavigator = MainDataSource.CreateNavigator()
which doesn't compile because MainDataSource is undefined, which makes
sense, since it's not.
My question: what is MainDataSource? Where does it come from?
thanks!
code is from site:
http://enterprise-solutions.swits.n...m-sharepoint-calendar-infopath&c=infopath2007
XPathNavigator root = MainDataSource.CreateNavigator();
// Retrieve the values for the calendar item
string title = root.SelectSingleNode("my:myFields/my:title",
NamespaceManager).Value;
string location = root.SelectSingleNode("my:myFields/my:location",
NamespaceManager).Value;
string startDate = root.SelectSingleNode("my:myFields/my:startDate",
NamespaceManager).Value;
string startTime = root.SelectSingleNode("my:myFields/my:startTime",
NamespaceManager).Value;
string endDate = root.SelectSingleNode("my:myFields/my:endDate",
NamespaceManager).Value;
string endTime = root.SelectSingleNode("my:myFields/my:endTime",
NamespaceManager).Value;
XPathNavigator batch = DataSources["EventCAML"].CreateNavigator();
// Set the title
batch.SelectSingleNode("/Batch/Method/Field[@Name='Title']",
NamespaceManager).SetValue(title);
// Set the location
batch.SelectSingleNode("/Batch/Method/Field[@Name='Location']",
NamespaceManager).SetValue(location);
// Set the start date
batch.SelectSingleNode("/Batch/Method/Field[@Name='EventDate']",
NamespaceManager).SetValue(string.Format("{0}T{1}Z", startDate,
startTime));
// Set the end date
batch.SelectSingleNode("/Batch/Method/Field[@Name='EndDate']",
NamespaceManager).SetValue(string.Format("{0}T{1}Z", endDate,
endTime));
// Submit the item details to the web service to update the calendar
DataConnections["Web Service Submit"].Execute();