D
David W
Hi
I understand that a dataadaptor can have multiple tablemappings, but how can
I get the schemas and or xml data of multiple tables to be written to the
same file, in one action, but have it so each table is separated in its own
block?
The below code shows 2 tables, but the select statement only retreives all
rows from one of the tables. Need some way select all from both tables but
when written to xml, they are separate tables?
OdbcDataAdapter myAdapter = new OdbcDataAdapter();
myAdapter.TableMappings.Add("Address", "DataAddress");
myAdapter.TableMappings.Add("Products", "DataProducts");
//myConnection.Open();
OdbcCommand myCommand = new OdbcCommand("SELECT * FROM \"Address\"",
myConnection);
myCommand.CommandType = CommandType.Text;
myAdapter.SelectCommand = myCommand;
DataSet ds = new DataSet("AllData");
myAdapter.Fill(ds);
ds.WriteXml("d:\\AllData.XML", XmlWriteMode.WriteSchema);
Thanks in Advance
David
I understand that a dataadaptor can have multiple tablemappings, but how can
I get the schemas and or xml data of multiple tables to be written to the
same file, in one action, but have it so each table is separated in its own
block?
The below code shows 2 tables, but the select statement only retreives all
rows from one of the tables. Need some way select all from both tables but
when written to xml, they are separate tables?
OdbcDataAdapter myAdapter = new OdbcDataAdapter();
myAdapter.TableMappings.Add("Address", "DataAddress");
myAdapter.TableMappings.Add("Products", "DataProducts");
//myConnection.Open();
OdbcCommand myCommand = new OdbcCommand("SELECT * FROM \"Address\"",
myConnection);
myCommand.CommandType = CommandType.Text;
myAdapter.SelectCommand = myCommand;
DataSet ds = new DataSet("AllData");
myAdapter.Fill(ds);
ds.WriteXml("d:\\AllData.XML", XmlWriteMode.WriteSchema);
Thanks in Advance
David