data doen't show in datagrid

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Hi

I have been trying to populate a data grid on a Windows CE 6.0 target with
the following code:

public void populateDataGrid()
{
dsMachineParameters = new DataSet("MachineParameters");
dsMachineParameters.EnforceConstraints = true;
this.dataGrid1.DataSource = dsMachineParameters;
try
{
Console.WriteLine("Read the schema" + xmlSchemaPath);
dsMachineParameters.ReadXmlSchema(xmlSchemaPath);
Console.WriteLine("Read the xmlPath" + xmlPath);
dsMachineParameters.ReadXml(xmlPath);
}
catch (Exception err)
{

MessageBox.Show(err.Message);
return;
}

}


I am using the same code in windows XP and the datagrid gets populated on the
screen. In windows CE it does not. Do I have to do anything more besides
read a schema and and xml in order to get it to show in the datagrid?
 
I'm not a DataSet lover so I don't have a great deal of experience with
DataSets but..You shouldn't need to read the schema method call *and* read
the data method call, do one or the other as ReadXml does in fact do both for
you. It seems in your case you want to bind the data so use just ReadXml()
method and lose the ReadXmlSchema() method. Try that.
 
Back
Top