Can someone look over my code??

#include "AddItem.h"

#pragma once

namespace My_Organizer {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Xml;

/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
private: System::Windows::Forms::ToolStripMenuItem^ addNewItemToolStripMenuItem;
public:

DataSet ^dsList;

protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::MenuStrip^ menuStrip1;
protected:
private: System::Windows::Forms::ToolStripMenuItem^ fileToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ exitToolStripMenuItem;
private: System::Windows::Forms::DataGridView^ MyGrid;
private: System::Windows::Forms::DataGridViewTextBoxColumn^ Item_Name;
private: System::Windows::Forms::DataGridViewTextBoxColumn^ Category;

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->MyGrid = (gcnew System::Windows::Forms::DataGridView());
this->Item_Name = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
this->Category = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
this->addNewItemToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->menuStrip1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->MyGrid))->BeginInit();
this->SuspendLayout();
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->fileToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(484, 24);
this->menuStrip1->TabIndex = 0;
this->menuStrip1->Text = L"menuStrip1";
//
// fileToolStripMenuItem
//
this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->exitToolStripMenuItem,
this->addNewItemToolStripMenuItem});
this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
this->fileToolStripMenuItem->Size = System::Drawing::Size(37, 20);
this->fileToolStripMenuItem->Text = L"File";
//
// exitToolStripMenuItem
//
this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
this->exitToolStripMenuItem->Size = System::Drawing::Size(152, 22);
this->exitToolStripMenuItem->Text = L"Exit";
this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
//
// MyGrid
//
this->MyGrid->AllowUserToAddRows = false;
this->MyGrid->AllowUserToDeleteRows = false;
this->MyGrid->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->MyGrid->Location = System::Drawing::Point(0, 27);
this->MyGrid->Name = L"MyGrid";
this->MyGrid->ReadOnly = true;
this->MyGrid->Size = System::Drawing::Size(484, 171);
this->MyGrid->TabIndex = 1;
this->MyGrid->CellContentClick += gcnew System::Windows::Forms::DataGridViewCellEventHandler(this, &Form1::MyGrid_CellContentClick);
//
// Item_Name
//
this->Item_Name->HeaderText = L"Item Name";
this->Item_Name->Name = L"Item_Name";
//
// Category
//
this->Category->HeaderText = L"Category";
this->Category->Name = L"Category";
//
// addNewItemToolStripMenuItem
//
this->addNewItemToolStripMenuItem->Name = L"addNewItemToolStripMenuItem";
this->addNewItemToolStripMenuItem->Size = System::Drawing::Size(152, 22);
this->addNewItemToolStripMenuItem->Text = L"Add New Item";
this->addNewItemToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::addNewItemToolStripMenuItem_Click);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(484, 184);
this->Controls->Add(this->MyGrid);
this->Controls->Add(this->menuStrip1);
this->MainMenuStrip = this->menuStrip1;
this->Name = L"Form1";
this->Text = L"My Organizer";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->MyGrid))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion

private: System::Void exitToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
Close ( );
}
private: System::Void MyGrid_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) {
}
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
dsList = gcnew DataSet ("list");
this -> dsList -> ReadXml ("Data.Xml");
this -> MyGrid -> DataSource = dsList;
this -> MyGrid -> DataMember = "item";
}
private: System::Void addNewItemToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
AddItem ^AddItemWindow = gcnew AddItem ();
AddItemWindow-> ShowDialog ();
}
};
}





I keep getting this error:
1> AddItem.cpp
1>c:\users\emily\documents\visual studio 2010\projects\my_organizer (3)\my_organizer\my_organizer\AddItem.h(162): error C2039: 'Appendchild' : is not a member of 'System::Xml::XmlElement'
1> c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\system.xml.dll : see declaration of 'System::Xml::XmlElement'
1> My_Organizer.cpp
1>c:\users\emily\documents\visual studio 2010\projects\my_organizer (3)\my_organizer\my_organizer\AddItem.h(162): error C2039: 'Appendchild' : is not a member of 'System::Xml::XmlElement'
1> c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\system.xml.dll : see declaration of 'System::Xml::XmlElement'

If someone could tell me how to fix this??? It's due today and my teacher isn't answering my email??
I googled "System::Xml::XmlElement"
http://msdn.microsoft.com/en-us/library/system.xml.xmlelement(v=vs.110).aspx

There is no "Appendchild" member function. There is, however, an "AppendChild" member function. C++/CLI is case-sensitive, just like C++ is.
Last edited on
Oh my gosh. Thank you so much! Now to finish the rest of the project! I owe you like 50 points of my grade :)
Topic archived. No new replies allowed.