private void LoadWarehouse()
{
try
{
string configFile = ComMethod.GetPath(Assembly.GetExecutingAssembly().GetName().CodeBase);
configFile += "\\WarehouseCache.xml";
DataSet ds = new DataSet();
ds.ReadXml(configFile);
OrgTable = new DataTable();
OrgTable.Columns.Add("cWhCode", typeof(string)); //编码
OrgTable.Columns.Add("cWhName", typeof(string)); //名称
foreach (DataRow row in ds.Tables["Company"].Select())
{
DataRow dr = OrgTable.NewRow();
dr["cWhCode"] = row["cWhCode"];
dr["cWhName"] = row["cWhName"];
OrgTable.Rows.Add(dr);
}
cboOrganization.DataSource = OrgTable;
cboOrganization.DisplayMember = "cWhName";
cboOrganization.ValueMember = "cWhCode";
}
catch (Exception ex)
{
}
}
<DocumentElement>
<Company>
<cWhCode>000101</cWhCode>
<cWhName>新厂一车间成品仓库</cWhName>
</Company>
<Company>
<cWhCode>000102</cWhCode>
<cWhName>老厂成品仓库</cWhName>
</Company>
</DocumentElement>

浙公网安备 33010602011771号