Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataSet ds = new DataSet();
- ds.ReadXml("C:\sites.xml");
- dataGridView1.DataSource = ds.Tables[0];
- this.dataGridView1.Columns[1].Visible = false;
- //filter
- ds.Tables[0].DefaultView.RowFilter = "date = '" + DateTime.Now.ToString() + "'";
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <sites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <site technical="1">
- <name>brian</name>
- <url>www.microsoft.com</url>
- <date>01/02/2012</date>
- </site>
- <site technical="2">
- <name>Mike</name>
- <url>www.news.com</url>
- <date>01/02/2012</date>
- </site>
- <site technical="3">
- <name>leslie</name>
- <url>www.cnet.com</url>
- <date>02/01/2012</date>
- </site>
- <site technical="4">
- <name>rebeca</name>
- <url>www.gamespot.com</url>
- <date>01/01/2012</date>
- </site>
- <site technical="5">
- <name>jenifer</name>
- <url>www.google.com</url>
- <date>02/01/2012</date>
- </site>
- </sites>
- ds.Tables[0].DefaultView.RowFilter = "date = #" + DateTime.Now.ToString() + "#";
- ds.Tables[0].DefaultView.RowFilter = "date = #" + DateTime.Now.ToString("MM/dd/yyyy") + "#";
- ds.Tables[0].DefaultView.RowFilter = "date = #" + DateTime.Now.ToString() + "#";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement