View previous topic :: View next topic |
Author |
Message |
tonyvsuk
Joined: 27 Jun 2016 Posts: 2
|
Posted: Fri Sep 02, 2016 1:49 pm Post subject: Command line sample project, any more XML file entries? |
|
|
Hello,
I've managed to build and run the command line sample project.
Are there any more valid entries that can go in the "sample.xml" file ? I was hoping I could add something like
<Company>My Company Inc</Company>
But this is ignored, the company field in the database is left blank.
Thanks in advance,
Tony. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Sep 02, 2016 11:54 pm Post subject: |
|
|
You can easily add any field that the database supports by changing the sample project code. Add the field you want eg Company to the Purchase class and then change the Read method to be able to read this property. Finally in the Program Main method you can add:
Code: | customer.Company = purchase.Comany |
to the following block of code:
Code: | if (customer == null)
{
customer = new Customer(database);
customer.LastName = purchase.LastName;
customer.FirstName = purchase.FirstName;
customer.Email = purchase.Email;
customer.Street = purchase.AddressStreet;
customer.City = purchase.AddressCity;
customer.State = purchase.AddressState;
customer.ZIP = purchase.AddressZip;
customer.Insert();
}
|
_________________ Infralution Support |
|
Back to top |
|
|
tonyvsuk
Joined: 27 Jun 2016 Posts: 2
|
Posted: Mon Sep 05, 2016 1:22 pm Post subject: |
|
|
Many thanks, all up and running now. |
|
Back to top |
|
|
|