<?xml version="1.0" standalone="yes"?> <NewDataSet> <Table1> <Host-Name>ixin-sovit</Host-Name> <Ip_Address>10.205.29.19</Ip_Address> <User_Name>sovit</User_Name> <Password>12345</Password> </Table1> </NewDataSet>
if (File.Exists(@"D:\HostAdded.xml") && new FileInfo(@"D:\HostAdded.xml").Length != 0) { dataGridView1.DefaultCellStyle.ForeColor = Color.Red; DataSet dataSet = new DataSet(); dataSet.ReadXml(@"D:\HostAdded.xml"); dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = dataSet; dataGridView1.DataMember = "Table1"; this.Cursor = Cursors.Default; }
.Designer.cs
DataPropertyName
Host-Name Ip_Address User_Name Password
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)