L
Lupina
I want to read two xml files, each in other DataGrid; I do it like this :
....
DataSet *myDataSet;
DataSet *myDataSetUpdates;
....
private: System::Void btnLoadAll_Click(System::Object * sender,
System::EventArgs * e)
{
try
{
myDataSet->ReadXml("news.xml");
this->dataGridCommon->DataSource = myDataSet;
this->dataGridCommon->DataMember = ComboBoxDataGridNews->Text;
}
catch (Exception *e)
{
MessageBox::Show(e->Message);
}
try
{
myDataSetUpdates->ReadXml("updates.xml");
this->dataGridCommon->DataSource = myDataSetUpdates;
this->dataGridCommon->DataMember = ComboBoxDataGridUpdates->Text;
}
catch (Exception *e)
{
MessageBox::Show(e->Message);
}
}
When I use onlny one DataSet everything is OK, but with second DataSet I get
error :
"object reference not set to an instance of an object."
Please Help.
....
DataSet *myDataSet;
DataSet *myDataSetUpdates;
....
private: System::Void btnLoadAll_Click(System::Object * sender,
System::EventArgs * e)
{
try
{
myDataSet->ReadXml("news.xml");
this->dataGridCommon->DataSource = myDataSet;
this->dataGridCommon->DataMember = ComboBoxDataGridNews->Text;
}
catch (Exception *e)
{
MessageBox::Show(e->Message);
}
try
{
myDataSetUpdates->ReadXml("updates.xml");
this->dataGridCommon->DataSource = myDataSetUpdates;
this->dataGridCommon->DataMember = ComboBoxDataGridUpdates->Text;
}
catch (Exception *e)
{
MessageBox::Show(e->Message);
}
}
When I use onlny one DataSet everything is OK, but with second DataSet I get
error :
"object reference not set to an instance of an object."
Please Help.