I have managed to write some code.
public void Button_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
string Id = MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:AOLObservation/@ID", NamespaceManager).Value;
string Key = MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:AOLObservation/d:AOL_Development/@Key", NamespaceManager).Value;
string Comments = MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:AOLObservation/d:AOL_Development/@Comments", NamespaceManager).Value;
SqlConnection MyConnection = new SqlConnection("server=vs-skunk;database=StaffDetails;UID=ework;PWD=ew0rk;");
SqlCommand command = new SqlCommand(@"INSERT INTO [AOL Development]" + "([AOLID],[Key],[Comments])" + "Values(@Id, @Key, @Comments)",MyConnection);
try
{
MyConnection.Open();
command.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
But I am getting an error message saying "Must declare the scalar variable "@Id"
Can you help?????