protected System.Web.UI.WebControls.DataGrid Dgaddinfo;
public String xmlfilename = "Zph.xml";
private void Page_Load (object sender, System.EventArgs e)
{
// datagriddatabind ();
if (! IsPostBack)
{
dataload ("ID");
  &NBSP}
}
#region
private void Dataload (string sortstring)
{
//string XMLfileName = @ "C:/inetpub/wwwroot/zhaopinhui/zph.xml";
dataset ds = new DataSet ();
filestream FS = new FileStream (Server.MapPath (XMLfileName), FileMode.Open);
ds. READXML (FS);
if (ds. Tables.count = = 0)
{
ds. Tables.add (Makezphtable ());
}
trace.warn ("rowcount1=", Convert.ToString (DS). Tables[0]. Rows.Count));
DataView dv =new DataView (ds. Tables[0]);
if (sortstring.length>0)
{
Dv. Sort = sortstring;
}
This.dgAddInfo.DataSource = DV;
This.dgAddInfo.DataBind ();
Fs. Close ();
}
#endregion
#region Create a Job fairs table
Private DataTable makezphtable ()
{
DataTable thetable = new DataTable ("Zph");
DataColumn theColumn1 = new DataColumn ();
Thecolumn1.datatype = System.Type.GetType ("System.Int32");
Thecolumn1.columnname = "ID";
THETABLE.COLUMNS.ADD (THECOLUMN1);
DataColumn theColumn2 = new DataColumn ();
Thecolumn2.datatype = System.Type.GetType ("System.Int32");
Thecolumn2.columnname = "Zphid";
THETABLE.COLUMNS.ADD (THECOLUMN2);
DataColumn theColumn3 = new DataColumn ();
Thecolumn3.datatype = System.Type.GetType ("System.String");
Thecolumn3.columnname = "Title";
THETABLE.COLUMNS.ADD (THECOLUMN3);
DataColumn theColumn4 = new DataColumn ();
Thecolumn4.datatype = System.Type.GetType ("System.String");
Thecolumn4.columnname = "Content";
THETABLE.COLUMNS.ADD (THECOLUMN4);
DataColumn theColumn5 = new DataColumn ();
Thecolumn5.datatype = System.Type.GetType ("System.DateTime");
Thecolumn5.columnname = "Date";
THETABLE.COLUMNS.ADD (THECOLUMN5);
DataColumn theColumn6 = new DataColumn ();
Thecolumn6.datatype = System.Type.GetType ("System.String");
Thecolumn6.columnname = "Time";
THETABLE.COLUMNS.ADD (THECOLUMN6);
DataColumn theColumn7 = new DataColumn ();
Thecolumn7.datatype = System.Type.GetType ("System.String");
Thecolumn7.columnname = "Num";
THETABLE.COLUMNS.ADD (THECOLUMN7);
datacolumn theColumn8 = new DataColumn ();
thecolumn8.datatype = System.Type.GetType ("System.String");
thecolumn8.columnname = "place";
thetable.columns.add (THECOLUMN8);
return thetable;
}