本文整理汇总了C#中DataSet1.ReadXml方法的典型用法代码示例。如果您正苦于以下问题:C# DataSet1.ReadXml方法的具体用法?C# DataSet1.ReadXml怎么用?C# DataSet1.ReadXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSet1
的用法示例。
在下文中一共展示了DataSet1.ReadXml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: add
/// <summary>
/// 增加
/// </summary>
public void add()
{
System.Text.StringBuilder list = new System.Text.StringBuilder();
DataSet ds = new DataSet1();
ds.ReadXml(Server.MapPath("work.xml"));
DataRow row = ds.Tables[0].NewRow();
row["cname"] = Request.QueryString["cname"];
row["cmoney"] = Request.QueryString["cmoney"];
row["mark"] = Request.QueryString["mark"];
ds.Tables[0].Rows.Add(row);
ds.WriteXml(Server.MapPath("work.xml"));
DataSet dss = new DataSet1();
dss.ReadXml(Server.MapPath("work.xml"));
int ircount = dss.Tables[0].Rows.Count;
int maxid = 0;
for (int i = 0; i < ircount; i++)
{
if (Convert.ToInt32(dss.Tables[0].Rows[i][0]) > maxid)
{
maxid = Convert.ToInt32(dss.Tables[0].Rows[i][0]);
}
}
list.Append("<tr id='d" + maxid + "'>");
list.Append("<td><a href='javascript:del(" + maxid.ToString() + ")'>删除</a></td>");
list.Append("<td>"+Request.QueryString["cname"]+"</td>");
list.Append("<td>" + Request.QueryString["cmoney"] + "</td>");
list.Append("<td>" + Request.QueryString["mark"] + "</td></tr>");
Response.Write(list.ToString());
Response.End();
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// Required code
this.ReportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence);
this.ReportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("Barcode, Version=1.0.5.40001, Culture=neutral, PublicKeyToken=6dc438ab78a525b3");
this.ReportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
// Data load
DataSet1 dataSet = new DataSet1();
dataSet.ReadXml(Server.MapPath("~/App_Data/Products.xml"));
ReportDataSource dataSource = new ReportDataSource("DataSet1_Products", dataSet.Products);
this.ReportViewer1.LocalReport.DataSources.Add(dataSource);
this.ReportViewer1.LocalReport.Refresh();
}
示例3: Form1
public Form1()
{
InitializeComponent();
dataset = new DataSet1();
try
{
dataset.ReadXml("Playlists.xml");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
TotalDuration = new TimeSpan(0, 0, 0);
myTimer = new Timer();
myTimer.Tick += new EventHandler(timer1_Tick); // Everytime timer ticks, timer_Tick will be called
myTimer.Interval = (1) * (1000); // Timer will tick evert second
//myTimer.Enabled = true; // Enable the timer
//myTimer.Start(); // Start the timer
newPlaylistCreated = false;
}