Quote:
I think there is something wrong with your XML.
>
Try this change and see if it leads you in the right direction?
>
GridView1.DataSource = ds; //.DefaultViewManager;
GridView1.DataBind();
>
>
"Toren Valone" wrote:
>
Hi, I have an XML file that I was hoping to use as a database
Here is the code that I have copied that should display the data
namespace File_Generation_System
{
public partial class vrholds : Form
{
public vrholds()
{
InitializeComponent();
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml("vrdatabase.xml");
DataSet ds = new DataSet("vrdata DataSet");
ds = xmlDatadoc.DataSet;
dataGridView1.DataSource = ds.DefaultViewManager;
}
But what I get is a blank square when my form loads. Here is the XML
<?xml version="1.0" encoding="utf-8"?>
<vrdatabase>
<vr_record>
<inquiry_data>
<license_number>
</license_number>
<record_creation_date>
</record_creation_date>
<citation_number>33</citation_number>
<date_vr_inquiry_sent_to_dmv>07072008</date_vr_inquiry_sent_to_dmv>
<vr_inquiry_received_from_dmv>
</vr_inquiry_received_from_dmv>
<vin_number>
</vin_number>
<as_of_date>999999 </as_of_date>
<file_code>
</file_code>
<model_year>
</model_year>
<make>
</make>
<experation_year>
</experation_year>
<paper_issued_date>
</paper_issued_date>
<name_address_data>
<ro_name_address_source_indicator>
</ro_name_address_source_indicator>
<ro_name>
</ro_name>
<ro_address>
</ro_address>
<ro_city>
</ro_city>
<ro_county_code>
</ro_county_code>
<new_owner_address_or_message>
</new_owner_address_or_message>
<new_owner_city_state_or_message>
</new_owner_city_state_or_message>
</name_address_data>
<release_of_liability_date>
</release_of_liability_date>
<transfer_date_or_message>
</transfer_date_or_message>
<new_owner_name_or_message>
</new_owner_name_or_message>
<record_id>
</record_id>
<errors>
<error_code_76>
</error_code_76>
<error_date_76>
</error_date_76>
<error_code_70_71_77>
</error_code_70_71_77>
<error_date_70_71_77>
</error_date_70_71_77>
</errors>
</inquiry_data>
<parking_hold>
<date_to_dmv>
</date_to_dmv>
<type_action_code>
</type_action_code>
<dispostion_code>
</dispostion_code>
<citation_number>
</citation_number>
<violation_date>
</violation_date>
<penalty_amount>
</penalty_amount>
<notice_date>
</notice_date>
<citation_paid_date>
</citation_paid_date>
</parking_hold>
</vr_record>
</vrdatabase>