protected void BindData()
{
try
{
DataView dvGridData;
AXGridView.PageIndexChanging += new GridViewPageEventHandler(AXGridView_PageIndexChanging);
AXGridView.PagerTemplate = null;
DataSet dsGridData = new DataSet();
dsGridData.ReadXml(Server.MapPath(FilePath)); //This is how I am reading XML file. This is where I need to test if it is written completely and if not need to wait for couple of seconds or until it is fully written.
if (dsGridData.Tables.Count > 0)
dvGridData = new DataView(dsGridData.Tables[0]);
else
dvGridData = new DataView();
dvGridData.RowFilter = FilterExpression;
AXGridView.DataSource = dvGridData;
AXGridView.DataBind();
}
catch
{
throw;
}
}
Thanks for the any help or code.
Thanks,
Dev
--
--
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to dotnetde...@googlegroups.com
To unsubscribe from this group, send email to
dotnetdevelopm...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net
---
You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotnetdevelopm...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks for the quick reply. But not sure if I understand what you meant. Can you please elobarate or a code snippet helps..
protected void BindData() { try { DataView dvGridData; AXGridView.PageIndexChanging += new GridViewPageEventHandler(AXGridView_PageIndexChanging); AXGridView.PagerTemplate = null; DataSet dsGridData = new DataSet();
//start of new code while (IsFileLocked(dsGridData)) { System.Threading.Thread.Sleep(500); } //end of new code
if (dsGridData.Tables.Count > 0) dvGridData = new DataView(dsGridData.Tables[0]); else dvGridData = new DataView(); dvGridData.RowFilter = FilterExpression; AXGridView.DataSource = dvGridData; AXGridView.DataBind(); } catch { throw; } }
protected Boolean IsFileLocked(DataSet dsGridData) { try { dsGridData.ReadXml(Server.MapPath(FilePath)); } catch (IOException) { return true; } //file is not locked return false; }Please provide if you have any comments on this.