[AccessD] XML (was: PDF vs Access)

Stuart McLachlan stuart at lexacorp.com.pg
Wed Sep 2 05:28:23 CDT 2009


"strongly typed data"???

XML data is inherently *not* typed. It is all text. If you do want to type it you have to start 
using attributes inside your tags which makes the parsing even more complex. Try moving 
your XML data between Access, .Net, MS SQL Server, mySQL, PHP etc etc and then tell 
me it is easy.

-- 
Stuart
 

On 2 Sep 2009 at 12:17, Gustav Brock wrote:

> Hi Stuart
> 
> No manual parsing, no nothing except strongly typed data.
> For example, if the sys table does not exist (first time run of the app), this code does it all:
> 
>   // New location. Create empty data file with system table.
>   DataSetDL.DataTableSysDataTable dataTableSys = DlDataSet.DataTableSys;
>   DataSetDL.DataTableSysRow dataTableSysRow = dataTableSys.NewDataTableSysRow();
> 
>   dataTableSysRow.SmtpServer = "localhost";
>   dataTableSys.AddDataTableSysRow(dataTableSysRow);
>   dataTableSys.AcceptChanges();
> 
>   DlDataSet.WriteXml(_dataBaseFile);
> 
> I love simple code like this, readable in one scan. 
> And this code (generated automatically behind the scenes on your order) binds the textbox to the field of the datatable:
> 
>    this.smtpServerTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataTableSysBindingSource, "SmtpServer", true));
> 
> But, of course, it's all a matter of taste. However, I've done enough construction and parsing of csv files previously to not miss that at all.
> 
> I don't understand why I shouldn't tell this is easy in .Net - or rather Visual Studio - it _is_ easy!
> 
> /gustav
> 
> 
> >>> stuart at lexacorp.com.pg 02-09-2009 11:19 >>>
> I'm well acquainted with it already thank you :-(
> 
> 388 characters to transmit 58 characters of data and you need a full parsing engine to 
> extract anything from it!
> 
> In what way is that preferable to something like this:
> 
> Id|SmtpServer|smtpUserName|SmtpPassword|EmailAddressSend|EmailAddressReceive
> 0|smtp.webpartner.dk|||cactus at cactus.dk|gustav at cactus.dk 
> 
> (Take your pick of delimiters, Pipes, Tabs, Nulls or anythiing else you want to use)
> 
> And don't tell me "because it is easy in .Net" -  I have similar feelings about .Net. 
> 
> 
> --  
> Stuart
> 
> On 2 Sep 2009 at 10:52, Gustav Brock wrote:
> 
> > Hi Stuart
> > 
> > To get acquainted with it. And it is simply too easy to justify reinventing a custom method.
> > Also, it is easy to document and to explain for some other developer who may wish to read the data.
> > 
> > For example, read one XML file with one dataset containing several tables:
> > 
> >         private void InitializeDataSet()
> >         {
> >             _dataBaseFile = Path.Combine(_execPath, _dataFileName);
> >             this.DlDataSet.ReadXml(_dataBaseFile);
> >         }
> > 
> > Write the (modified) dataset to one XML file:
> > 
> >         private void SaveData()
> >         {
> >             this.DlDataSet.WriteXml(_dataBaseFile);
> >         }
> > 
> > Resulting XML for one table with one record:
> > 
> > <?xml version="1.0" standalone="yes"?>
> > <DataSetDL xmlns="http://tempuri.org/DataSetDL.xsd">
> >   <DataTableSys>
> >     <Id>0</Id>
> >     <SmtpServer>smtp.webpartner.dk</SmtpServer>
> >     <SmtpUserName />
> >     <SmtpPassword />
> >     <EmailAddressSend>cactus at cactus.dk</EmailAddressSend>
> >     <EmailAddressReceive>gustav at cactus.dk</EmailAddressReceive>
> >   </DataTableSys>
> > </DataSetDL>
> > 
> > /gustav
> 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list